Session

Moduleejs.web
Definitiondynamic class Session
InheritanceSession inherit Object
Specifiedejscript-2.5

Session state storage class.

The session state objects can be used to share state between requests. The Request object has a Request.session property that stores a Session object instance. Values stored into the session state are serialized and deserialized upon retrieval.


Properties

(No own properties defined)


Session Class Methods

QualifiersMethod
static destorySession(session: Session): Void
 Destroy a session.
static key(session: Session): String
 Get the session ID key for a session.

Session Instance Methods

QualifiersMethod
Session(key, options: Object = null)
 Create a new session state object.

Method Detail

ejs.web Session(key, options: Object = null)
Description
Create a new session state object. This uses the Store in-memory caching service.
Parameters
key Optional key to provide. If omitted or null, a new key will be generated. If the given key has expired, a new key will be generated.
options: Object null [default: null]
options: Object null [default: null]
Options
lifespanLifespan in seconds for the session.

static destorySession(session: Session): Void
Description
Destroy a session.
Parameters
session: Session Session to destroy H.

static key(session: Session): String
Description
Get the session ID key for a session. This is a static method so as to not clash with session properties.
Parameters
session: Session Session to examine.
Returns
The session ID key.