API Docs for: 0.8.0
Show:

MongoSessionStore Class

Session storage backed by MongoDB

Item Index

Properties

Methods

clear

(
  • sessionId
  • cb
)

Deletes a session if it exists.

Parameters:

  • sessionId String
  • cb Function

    Callback of form cb(err, [int SESSIONS_CLEARED])

get

(
  • sessionId
  • cb
)

Responsible for retrieving the session for persistent storage.

Parameters:

  • sessionId String

    The identifier of the session to retrieve.

  • cb Function

    Callback of form cb(err, [Object])

getHandler

(
  • cb
)
Function static

Parameters:

  • cb Function

Returns:

Function:

getSessionQuery

(
  • sessionId
)
Object

Constructs a query to find a session in Mongo

Parameters:

  • sessionId String

    The session identifier

Returns:

Object:

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 Function

    Callback 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