MongoSessionStore Class
Session storage backed by MongoDB
Item Index
Methods
- clear
- get
- getHandler static
- getSessionQuery
- set
- shutdown
- start
Properties
- INDEX_MOD_LOCK_KEY static
- SESSION_COLLECTION_NAME static
Methods
clear
-
sessionId
-
cb
Deletes a session if it exists.
Parameters:
-
sessionId
String -
cb
FunctionCallback of form cb(err, [int SESSIONS_CLEARED])
get
-
sessionId
-
cb
Responsible for retrieving the session for persistent storage.
Parameters:
-
sessionId
StringThe identifier of the session to retrieve.
-
cb
FunctionCallback of form cb(err, [Object])
getHandler
-
cb
Parameters:
-
cb
Function
Returns:
getSessionQuery
-
sessionId
Constructs a query to find a session in Mongo
Parameters:
-
sessionId
StringThe session identifier
Returns:
set
-
session
-
cb
Responsible for persisting the session object between user requests
Parameters:
-
session
!~YUIDOC_LINE~! uid: primitive!~YUIDOC_LINE~!The session object to store. The session object must contain the following in addition to other data:
-
cb
FunctionCallback of form cb(err, 'OK')
shutdown
-
cb
Responsable for shutting down the session store and any resources used for reaping expired sessions.
Parameters:
-
cb
Function
start
()
Responsable for ensuring that the mechanism that expires sessions becomes active.
Properties
INDEX_MOD_LOCK_KEY
String
private
static
The cache lock key used when the index is needed to be modified
SESSION_COLLECTION_NAME
String
private
static
The mongo collection that stores the sessions