CAT-SOOP API: catsoop.session
cslog package.
Members
-
catsoop.session.EXPIRE (
int)Number of seconds since last action to keep a session as valid. Defaults to two weeks.
-
catsoop.session.SESSION_DIR (
str)The directory where sessions will be stored.
-
catsoop.session.VALID_SESSION_RE (
Pattern)Regular expression matching a valid session id name (32 hexadecimal characters)
-
catsoop.session.get_session_data (
function, lines 92-103)Returns the session data associated with a given session ID
Parameters:
context: the context associated with this requestsid: the session ID to look up
Returns: a dictionary mapping session variables to their values
-
catsoop.session.get_session_id (
function, lines 62-89)Returns the appropriate session id for this request, generating a new one if necessary.
As a side-effect, deletes all expired sessions.
Parameters:
environ: a dictionary mapping environment variables to their values
Returns: a tuple
(sid, new), wheresidis a string containing the session ID, andnewis a Boolean that takes valueTrueif the session ID is new (just now generated), andFalseif the session ID is not new.
-
catsoop.session.new_session_id (
function, lines 53-59)Returns a new session ID
Returns: a string containing a new session ID
-
catsoop.session.set_session_data (
function, lines 106-118)Replaces a given session's data with the dictionary provided
Parameters:
context: the context associated with this requestsid: the session ID to replacedata: a dictionary mapping session variables to values
Returns:
None