Thursday, July 16, 2009

Session variable lifetime

 

Before I talk about session variable's life time, Ill just brief why a session variable comes in to play with a web application.

A session is a mechanism to maintain state on a web application, as HTTP protocol is a stateless protocol. What does it means by stateless? this protocol (HTTP) serves as the request comes and destroys all the data (information) on a request. Pages are destroyed and recreated with each round trip to server. Session variables comes in to play when there is a requirement to maintain the state of a web application. Do not misunderstand that session is not the only mechanism to available to maintain state of a web application. Ok, will get back to the topic.

On an ASP.Net application session variable's expiry time decides the life time of a Session
set in the web.config configuration section under
Example:

< sessionState mode="InProc"  timeout="20" >

In the above example the timeout = "20" sets the
expiry time of session variables to 20 minutes.

0 comments:

My Achievements

Member of

Blog Archive

Followers