Thanks so much, it is working now but, is there an...
# support-questions-legacy
r
Thanks so much, it is working now but, is there any way to handle it directly from Backend? I mean, if I detect that the session is expired on Backend, is there anyway to refresh it directly from there, instead of responding with "try refresh token" message to Frontend and getting request on auth/session/refresh? I know it is conceptually different from what SuperTokens is for, but I am trying to handle something else with described scenario.
r
Hey! That’s not possible and nor is it recommended. It’s not possible cause the refresh token is not sent on all api calls. Just the refresh one. This also increases security.
What are you trying to achieve? Maybe there is a better way
r
I want to be able to monitor user activities even when they are not logged in
r
Ah I see. You can still use this same session management for that. Since you can provide any ID to createNewSession, you can just generate a random ID in that case
r
I am trying to avoid deleting/revoking the session! and I am just changing the sessionData to make sure user is logged in or not and with other data, I am trying to monitor them
r
Oh I see. I wouldn’t recommend that you do that. Instead, when a user logs out, you can override the sign out api, to create a new session in it with an anonymous ID instead. And transfer the session data from the logged in session to the logged out one.
And when a user logs in, you create a new session with their actual user id and transfer the data from the anonymous session to the logged in one
In fact, there is a better way to manage all of this for logged out sessions using our JWT recipe. It makes tracking users when logged out simple, whilst scaling very well (in case you get lots of anonymous users). And finally you can use that to transfer session data between logged in sessions as welll
I can make a quick demo app in 1-2 days time to showcase this. Seems like a useful example
r
hmmm sounds great I will be so happy to have a demo also, but I don't want to bother you I will try my best for tomorrow but please if you find time, it will be so great to have a demo like that
r
Cool. If I get time, I’ll make a demo app 🙂
r
Thank you so much thanks again for your time
2 Views