Class Session
- Defined in: Session.js
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Session()
|
Method Summary
| Method Attributes | Method Name and Description |
|---|---|
|
end()
Ends the session.
|
|
|
getId()
|
|
|
Returns the time at which the session was last accessed.
|
|
|
initialize(request)
Initializes a new session.
|
|
|
isEnded()
Returns true if the session has been ended.
|
|
| <static> |
Session.makeId()
Returns a new session key generated with the usual lame algorithm.
|
|
stillValid(timeout)
Returns true if this session is still valid (not expired).
|
|
|
touch()
Updates the session mtime.
|
Class Detail
Session()
Method Detail
-
end()Ends the session.
-
getId()
- Returns:
- string
-
getLastSaveTime()Returns the time at which the session was last accessed.
-
initialize(request)Initializes a new session.
- Parameters:
- request
- optional request for which this session is being initialized
-
isEnded()Returns true if the session has been ended.
-
<static> Session.makeId()Returns a new session key generated with the usual lame algorithm. I'd rather pull the keys from /dev/urandom or a crypto PRNG; Math.random() is usually pretty weak.
-
stillValid(timeout)Returns true if this session is still valid (not expired).
- Parameters:
- timeout
- session timeout in seconds
-
touch()Updates the session mtime.