Page

8.3.0- What is a Session?

  by NT Community Manager.
Last Updated  by NT Community Manager.  

PublicCategorized as 08. Applications, Sessions and Cookies.

Not tagged.
<< 8.2.4- Global.asaChapter88.4.0- The Session Object >>

What is a Session?

In addition to providing support for applications across theweb, Active Server Pages also supports sessions within an application. We havejust looked at how applications are created and at some of the things that youcan do with them. To begin our look at sessions, we first need to define what asession is.

 

ASP allows the developer to track a user from page to pagein an application through the use of a session.A user's session begins when any user without a current session opens any .asp page within an ASP Application. The user's sessionwill continue as they navigate from page to page in the site.

 

There are two ways that a session can be terminated. If theuser stops interacting with the application, then the session will end after acertain period of time has elapsed. The default value for this time period is20 minutes, which can be changed by setting the Session.TimeOutproperty. The Session.Abandon statement in an ASPpage can also explicitly end the session.

 

The session can be used to store pieces of information thatwill be available to every page in the application and each user as privateinstances of those pieces of information. This can be used to track things likethe contents of a user's shopping basket, or a flag indicating that this userhas been properly authenticated with the system. In addition, just as there areevent handlers in global.asa for the beginning andend of an application, you can also write an event handler that will be calledwhen a session is started and when it is ended.

 

To interact with the session itself, you will be using the Session object.

<< 8.2.4- Global.asaChapter88.4.0- The Session Object >>

Copyright © 2003 by Wiley Publishing, Inc.

Powered by Near-TimeTerms of Services | Privacy Policy | Security Policy |