Session
Module | ejs.web |
Definition | dynamic class Session |
Inheritance | Session ![]() |
Specified | ejscript-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
Qualifiers | Method |
---|---|
static | destorySession(session: Session): Void |
Destroy a session. | |
static | key(session: Session): String |
Get the session ID key for a session. |
Session Instance Methods
Qualifiers | Method |
---|---|
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
lifespan Lifespan in seconds for the session.
- Description
- Destroy a session.
- Parameters
session: Session Session to destroy H.
- 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.