API Docs for: 0.8.0
Show:

SessionHandler Class

Responsible for managing user sessions

Item Index

Properties

Methods

close

(
  • session
  • cb
)

Closes the session and persists it when no other requests are currently accessing the session.

Parameters:

  • session Object
  • cb Function

create

(
  • request
)
Object

Creates the shell of a session object

Parameters:

  • request Object

Returns:

Object:

Session

end

(
  • session
  • cb
)

Sets the session in a state that it should be terminated after the last request has completed.

Parameters:

  • session Object
  • cb Function

getClientId

(
  • request
)
String static

Generates a unique client ID based on the user agent and the remote address.

Parameters:

  • request Object

Returns:

String:

Unique Id

getSessionCookie

(
  • session
)
Object static

Parameters:

  • session Object

Returns:

Object:

getSessionIdFromCookie

(
  • request
)
String static

Extracts the session id from the returned cookie

Parameters:

  • request Object

    The object that describes the incoming user request

Returns:

String:

Session Id if available NULL if it cannot be found

getSessionStore

() Function static

Loads a session store prototype based on the system configuration

Returns:

Function:

getSessionStore

() SessionStore static

Retrieves an instance of the SessionStore specified in the sytem configuration

Returns:

SessionStore:

open

(
  • request
  • cb
)

Retrieves a session for the current request. When the session ID is available the existing session is retrieved otherwise a new session is created.

Parameters:

  • request Object

    The request descriptor

  • cb Function

    The callback(ERROR, SESSION_OBJ)

shutdown

(
  • cb
)

Shuts down the sesison handler and the associated session store

Parameters:

  • cb Function

start

(
  • cb
)

Parameters:

  • cb Function

Properties

HANDLER_PATH

String static

HANDLER_SUFFIX

String static

SID_KEY

String static

TIMEOUT_KEY

String static