ASP » Objects » Session

Version: Modified in version 3.0

The first time a user makes a document request, a Session object is assigned to the user and it is used to store, share, and retrieve information concerning the user session. By default, the Session object is destroyed after a session has been idle for twenty minutes.

Properties

CodePage

The CodePage property specifies the server codepage that will be used to display dynamic content.

LCID

The LCID property specifies the location identifier that will be used to display dynamic content.

SessionID

The SessionID property returns the unique identifier for a user session.

Timeout

The Timeout property is the length of time in minutes before an idle session is terminated.

Methods

Abandon

Syntax: Session.Abandon

The Abandon method terminates a user session, destroys all data and objects in the current Session object, and releases its resources.

Contents.Remove

Syntax: Session.Contents.Remove (Name|Integer)

The Contents.Remove method is used to remove a single item from a Contents collection.

Contents.RemoveAll

Syntax: Session.Contents.RemoveAll

The Contents.RemoveAll method is used to remove all items from a Contents collection.

Collections

Contents

Syntax: Session.Contents(Key)

The Contents collection property contains all of the items that have been created and added to the Session object through script commands, rather than using the HTML <OBJECT> tag.

StaticObjects

Syntax: Session.StaticObjects(Key)

The StaticObjects collection property contains all of the items created in the Global.asa file using the HTML <OBJECT> tag within the scope of the Session object.

Events

OnEnd

The OnEnd event occurs when the Session quits. The signal of this event will run a handler script in the Global.asa file, if the script exists.

OnStart

The OnStart event occurs before the start of any new Session by a user. The signal of this event will run a handler script in the Global.asa file, if the script exists.