Is there a way to prevent session id restore on startup/restart of user's system?
We are using a asp.net app and I am able to login and access the site. For the first time session id is created and stored in cookies.
Problem:
But if I restart my system without signing out, the session is still alive.
How can I prevent this? from server side.
I can try to delete cookies but it is not practical, as each user will have different preferences.
1 Answer 1
I assume we are talking about a web application over HTTP, which is stateless by nature. I'm not sure this is doable. How would a server know that your client has restarted?
Alternative is to make session time-out really short (1 minute) and refresh it every 30 seconds through AJAX calls.
-
-
Yes it's a web app. Also, i came across SystemEvents Class while searching and found i could use sessionending event to detect restart or logoff. Is this possible. msdn.microsoft.com/en-us/library/… Can you tell me if it is the right solution? or is there any cons. We are already using ajax keep alive for short intervel. Kindly suggest.user100124– user1001242013年08月21日 08:41:35 +00:00Commented Aug 21, 2013 at 8:41