Heybo Blog

If you look at me when I'm talking, you'll see what I'm saying ... about Tech and .NET discoveries!

My Links

News

Story Categories

Archives

Post Categories

Image Galleries

Login

Blog Stats

Links

Personal Websites

ASP.Net Session State Management Terms

The Session object in ASP.net allows your applications to store information pertaining to a unique user “session“. This session is identified to a user separately for a particular time. The default length of a sesssion is 20 minutes, which time starts after the last page serverd. For example, if you want to keep up with a user login, you could save it with Session[“login“] = username.

Sessions allow your application to store data separately for different users. It is as a Hashtable. The Hashtable Object contains data in key-value pair. The 'pair' will be valid as long as specified, which is usually the session length.

To recover the login as stored above, you could use

username = (string) Session[“login“]

Session Methods

Ø      Add - adds a new session key

Ø     Abandon - cancels the current session

Ø     Clear - clears all values from the session 

Ø     Remove - removes a session state key

Ø      RemoveAll  - removes all session state keys

Session Properties 

Ø       TimeOut                             Session.Timeout = 30 
Ø       SessionID                            Current session ID 

Ø       IsNewSession                      Only true for the first page served from web application.

 

Ø       Count                                     Returns the number of keys

 

Ø       IsCookieless                         If true,  the session ID is embedded in the URL, other wise a cookie is used. 

 

Ø       Mode                                     Can be one of the following:

  1. InProc : Session state is in process with an ASP.NET worker process. (default.)

  2. Off : Session state is disabled.

  3. StateServer: Session state is using an out-of-process Windows NT Server to store state information.

  4. SQLServer: Session state is using an out-of-process SQL Server to store state information.

I hope that this will be useful for you with your ASP.NET applications.

 

?>

posted on Thursday, March 04, 2004 1:57 PM

Feedback

No comments posted yet
Title  
Name  
Url
Comments   
Protected by Clearscreen.SharpHIPEnter the code you see: