Page 1 of 1

having an issue with sessionkeys

Posted: Mon Feb 10, 2020 10:35 am
by cshrimpt
Hi,

I'm having an issue with sessionkeys where when a user is disconnected or hits the back button on their browser the user can no longer reconnect to their session. I'm assuming if I were to send the same key when the user tries to reestablish the connection it work work the same as if they used a user/password login.

I was thinking of using cookies to save the session key until the user either logs out or is disconnected for more than two minutes. Once that condition is met, I assume the key expires and a new one would be needed.

Is my thinking correct on this?

Also, how long is the key good for before it expires? In other words, if a key is requested but the user doesn't immediately login, how long is the requested key valid? Is it time based, or based on fetching another key?

Thanks,

Craig

Re: having an issue with sessionkeys

Posted: Mon Feb 10, 2020 11:01 am
by Kent Briggs
Session keys are single-use only. Once generated they are held in memory until that player either logs in, has a new key overwrite it, or the server is taken offline. Otherwise there is no time limit. But the key is consumed immediately on login and cannot be re-used. Any attempt to reload the client with a browser refresh button or F5 key causes a client reload, which causes a new login request, which requires a fresh session key. Note that if the client detects a connection drop, it will automatically try to establish a reconnection on its own. That does not require a new session key.

Re: having an issue with sessionkeys

Posted: Mon Feb 10, 2020 11:27 am
by cshrimpt
What's messing me up is I'm getting the invalid/expired message popup making me think that I've lost the session, but if I click the OK button, I see I'm actually still connected.

Anyway to suppress that message if I'm actually still logged in? It will confuse the user.

Craig

Re: having an issue with sessionkeys

Posted: Mon Feb 10, 2020 12:18 pm
by cshrimpt
Never mind the previous reply. I think my issue is I'm not sending the key I think I am. Need to do a little more debugging.

Thanks