Question Is it necessary to terminate session?

raysefo

Well-known member
Joined
Jul 21, 2010
Messages
207
Programming Experience
Beginner
Hi,

I m using Sessions in my application. I would like to know if its necessary to terminate sessions. If so, when to terminate sessions?

Thanks in advance.

Best Regards
 
If you have functionality in your application that determine end of session, for example 'log out', you should abandon session. Or perhaps you have program flow that determine that lifecycle of some items stored in session has ended, then you should clear these to free up server resources. If not the default behaviour is that server (IIS) terminates the session after idle (no requests) timeout of 10-20 minutes.
 
Remains. Closing a browser does not send another requst to server (one that would request server to terminate session that is). Session state is stored at server, and the clients session id usually stored in a cookie at client. As server concerns it must maintain the state until timeout, so if client close browser, then open the ASP.Net app again and make a request within the timeout then the stored session id is still valid.
 

Latest posts

Back
Top