Package WebStack :: Package Helpers :: Module Session :: Class SessionStore
[show private | hide private]
[frames | no frames]

Class SessionStore


A class representing a session store.

Method Summary
  __init__(self, trans, session_directory, session_cookie_name, delay)
Initialise the session store, specifying the transaction 'trans' within which all session access will occur, a base 'session_directory', and the optional 'session_cookie_name' where the session identifier is held for each user.
  close(self)
Close the store, tidying up files and filenames.
  expire_session(self)
Expire the session in the given transaction.
  get_session(self, create)
Get the session for the given transaction, creating a new session if 'create' is set to 1 (rather than 0).
  _expire_session(self, session_id)
Expire the session with the given 'session_id'.
  _get_session(self, session_id, create)
Get a session with the given 'session_id' and whether new sessions should be created ('create' set to 1).
  _get_session_identifier(self)
Return a session identifier as a string.

Method Details

__init__(self, trans, session_directory, session_cookie_name='SID', delay=1)
(Constructor)

Initialise the session store, specifying the transaction 'trans' within
which all session access will occur, a base 'session_directory', and the
optional 'session_cookie_name' where the session identifier is held for
each user.

The optional 'delay' argument specifies the time in seconds between each
poll of the session file when that file is found to be locked for
editing. (This is part of the underlying repository's behaviour.)

close(self)

Close the store, tidying up files and filenames.

expire_session(self)

Expire the session in the given transaction.

get_session(self, create)

Get the session for the given transaction, creating a new session if
'create' is set to 1 (rather than 0). Where new sessions are created, an
appropriate session identifier cookie will be created.
Returns a session object or None if no session exists and none is then
created.

_expire_session(self, session_id)

Expire the session with the given 'session_id'.

_get_session(self, session_id, create)

Get a session with the given 'session_id' and whether new sessions
should be created ('create' set to 1).
Returns a dictionary-like object representing the session.

_get_session_identifier(self)

Return a session identifier as a string.

Generated by Epydoc 2.1 on Thu Mar 1 00:37:14 2007 http://epydoc.sf.net