The application mixin works in concert with the SessionFileContextMixin execution context method to store sessions in the local file-system.
Whenever there are problems reading or writing sessions from or to disk, the class raises a SessionFileError exception, which is a subclass of SessionError. Unless you have a reason to do otherwise, catch SessionError rather than SessionFileError, as this allows other Session classes to be substituted with minimal change.
appid , session_dir) |
The appid argument specifies the name of the cookie attribute which is used to store the session id. This uniquely identifies the application at the web server. Multiple applications can share sessions by defining the same value in this argument.
The session_dir argument specifies the location on the local file-system in which this application's sessions will be stored.
The directory should not be publicly readable, as the session file names are the session id's (knowing a session id allows an attacker to steal that session).
Sessions recorded via this class are not automatically aged. An external process will be required to clean orphaned sessions from the session directory (for example, by removing any file that has not been accessed in the last two hours).
) |
sesid) |
None
is returned.
) |
Note that if the session_dir passed to the constructor does not already exist, this method will attempt to create it.
sesid, text) |
sesid) |