ASP Hosting sale!
1,000MB space, 40GB transfer, 1 SQL Server 2000 db! - $9.95 per month*!
Limited Time Offer!

aspdev | articles | tutorials | forums

ASPdev -> ASP Tutorial -> ASP Session

ASP Session

The ASP Session object is used to store data related to a particular user session. When you store variables in the ASP Session object, those variables can be accessed during the entire user session. The values of the ASP Session variables are preserved while user navigates between the ASP application web pages.

When a user requests its first page from an ASP web application, the IIS automatically creates a new ASP Session object for the user.

ASP Sessions are maintained by using cookies, so make sure your users have cookies enabled if you want to use ASP Session object.

The Session.Abandon method destroys the Session object and frees its resources.

The Session.TimeOut property defines the ASP Session timeout period in minutes.

Here is how to store data in an ASP Session variable:

Session(“VariableName”) = “VariableValue”

You can store objects in an ASP Session variables, but this is not recommended.

You can read and display the value stored in an ASP Session variable, in the following way:

Response.Write Session(“VariableName”)

Contact Us