1

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.

gnat
20.5k29 gold badges117 silver badges308 bronze badges
asked Aug 21, 2013 at 6:29

1 Answer 1

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.

answered Aug 21, 2013 at 7:16
2
  • I will try that. Commented Aug 21, 2013 at 8:39
  • 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. Commented Aug 21, 2013 at 8:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.