SDK does not have a way to refresh the client session. There is only a SessionHandler that allows to react to issues connected with session, however it is neither included in the documentation nor it is clear if that refers session token or “client session”.
Is there any way to smoothly react in this scenario? Will disconnection/reconnection on onSessionExpired be the option?
I must admit that calling this “session” makes life difficult, because expiration of “client session” is not connected with longevity of “session token”.
If you define 8hs then it should be good for that time. Can you please provide more details (code snippet or Api call maybe) so we can investigate in case or error? Thanks!
@walter.rodriguez
Correct. Our backend is using update user endpoint for creating the session token. However following that session issue I assume there are two expirations possible. One is from the client (expiration of the session) and second is expiration of the session token.
Do you have maybe information how long the session can be ongoing with expired session token (see the other issue)? I assume that’s an issue for us, that the user continues using SDK, when the session token expired. However that’s hard to debug, because of having this implicit timeout that we cannot control.
The session expiration happens in case of locking the device (laptop or phone) for longer than 30 minutes. If user comes back after that time to the tab in the browser, the session will be expired, regardless of session expiration token.
onSessionExpired event will be triggered in that case from SessionHandler so you can have your logic around it.
For building general logic around tab visibility and/or locking the device, please check stackoverflow issue.
Takeaways:
SDK does not include that event, however TypeScript types reflect the possibilities well.