How do I make sessions persist across browser/server restarts?
I'm using Google AppEngine.
I'm getting a new session id everytime I restart my browser and/or server.
String jSessionId=this.getThreadLocalRequest().getSession().getId();
End Goal
The big win I'm shooting for is long lived anonymous accounts.
For example, a user can do action A, have an anonymous account created on their behalf, then come back the next day and do action B with the same anonymous account they did action A with(assuming they didn't clear their cookies in between).
And at some point, once they've been drawn in, they can decide to validate/register their account and keep credit for the anonymous stuff they've already done.
Unless I'm mistaken here, and I well could be (if Google changes the internals of GAE), GAE uses both memcache and DataStore for session management. Hence, session data will be present in the DataStore during the course of the session.
If you intend to have persistent sessions, you have two possible course of action:
PS: Server restarts on GAE should ideally be considered far and few. Of course, don't count on this, since GAE could have an outage, in which case the application itself would be unavailable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With