API Docs for: 0.8.0
Show:

RedisSessionStore Class

Session storage backed by Redis

Constructor

RedisSessionStore

()

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
)

Responsable 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])

getSessionKey

(
  • sessionId
)
String static

Constructs a session cache key provided a session id.

Parameters:

  • sessionId String

Returns:

String:

[RedisSessionStore.SESSION_KEY_PREFIX][sessionId]

set

(
  • session
  • cb
)

Responsable for persisting the session object between user requests

Parameters:

  • session Object

    The session object to store. The session object must contain the following in addition to other data:

    {
        uid: [primitive]
    }
    
  • 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

(
  • cb
)

Repsonsible for ensuring that the mechanism that expires sessions becomes active.

Parameters:

  • cb Function

Properties

SESSION_KEY_PREFIX

String static

The prefix to prepend to the session ID in order to construct a cache key