Codecore Logo
Quick Search
»
Advanced Search »

Session Object

RSS
Provides access to session-state values as well as session-level settings and lifetime management methods.


Instance Properties

Count

Gets the number of items in the session-state collection.

Accessibility : Read Only

Type: Number

SessionID

Gets the unique session ID used to identify the session.

Accessibility : Read Only

Type: String

Timeout

Gets and sets the amount of time, in minutes, allowed between requests before the session-state provider terminates the session.

Accessibility : Read/Write

Type: Number

Instance Methods

Abandon

Cancels the current session.

Syntax:

void Abandon()

Example:


Session.Abandon();

Add

Adds a new item to session state.

Syntax:

void Add( String name, Object value)

Parameters:

name: The name of the session-state item to add.

value: The value to add to the session-state.

Example:


Session.Add("UserName", "John Doe");

Clear

Removes all keys and values from the session-state collection.

Syntax:

void Clear()

Example:


Session.Clear();

Get ( Number )

Gets as session state object by numerical index.

Syntax:

Object Get( Number index )

Parameters:

index: The index of the session state object.

Return Value:

The object referenced by index.

Example:


x = Session.Get( 1 );

Get ( String )

Gets a session state object by name.

Syntax:

Object Get( String name )

Parameters:

name: The name of the object.

Return Value:

The object referenced by name.

Example:


username = Session.Get( "UserName" );

Remove

Removes the named object from an session state collection.

Syntax:

void Remove( String name )

Parameters:

name: The name of the object to be removed from the collection.

Example:


Response.Remove("UserName");

RemoveAll

Removes all objects from the session state collection.

Syntax:

void RemoveAll( )

Example:


Session.RemoveAll();

RemoveAt ( Number )

Removes a session state object from a collection by index.

Syntax:

void RemoveAt( Number index )

Parameters:

index: The position in the collection of the item to remove.

Example:


x = Session.RemoveAt( 1 );

See Also

Application Object
Request Object
Response Object
Server Object
Privacy Policy | Conditions Of Use

Copyright ©2014 Codecore Technologies, All rights reserved.