One of our user observed that when he closed Firefox running session abruptly and joined using Chrome browser, old connection was still lingering around. However, I could not reproduce it on my system. To overcome this issue, I thought I will store all generated token and if a new request comes from same user, I will pass already generated token. But there is a problem here, how to check that token is valid ?
I was also curious if there was a way to check if a token was valid.
I think if you use a token to request sessions and the token is invalid you’ll get an invalid response? May not be the most efficient way to test this.
it will be good if there’s api to check the token is valid or not
My 2¢: don’t store tokens, they are short-lived and consumed on the joinRoom
method, they cannot be reused in this case. Just generate new ones when needed.
Use your server logic to determine if the user is already connected. You can also call the Retrieve active session info REST API method to see the connected users. You could disconnect them and generate a new token for the new connection.
1 Like
Thank you @mihailj.
Your proposed solution is the best one.