class documentation

class DirectorySessionStore(SessionStore):

Constructor: DirectorySessionStore(directory, create)

View In Hierarchy

Store sessions in individual files within a directory.

Method __init__ __init__ takes a directory name, with an option to create it if it's not already there.
Method delete_old_sessions Delete all sessions that have not been modified for N minutes.
Method delete_session Delete the session file.
Method load_session Load the pickled session from a file.
Method save_session Pickle the session and save it into a file.
Class Variable is_multiprocess_safe Undocumented
Class Variable is_thread_safe Undocumented
Class Variable pickle_protocol Undocumented
Instance Variable directory Undocumented
Method _make_filename Build the filename from the session ID.

Inherited from SessionStore:

Method has_session Return true if the session exists in the store, else false.
Method iter_sessions Return an iterable of (id, session) for all sessions in the store.
Method setup Initialize the session store; e.g., create required database tables. If a previous store exists, overwrite it or raise an error. The default implmenetation does nothing, meaning no setup is necessary.
def __init__(self, directory, create=False):

__init__ takes a directory name, with an option to create it if it's not already there.

def delete_old_sessions(self, minutes) -> tuple[int, int]:

Delete all sessions that have not been modified for N minutes.

This method is never called by the session manager. It's for your application maintenance program; e.g., a daily cron job.

DirectorySessionStore.delete_old_sessions returns a tuple:

(n_deleted, n_remaining)
def delete_session(self, session):

Delete the session file.

def load_session(self, id, default=None):

Load the pickled session from a file.

def save_session(self, session):

Pickle the session and save it into a file.

is_multiprocess_safe: bool =
is_thread_safe: bool =
pickle_protocol: int =

Undocumented

directory =

Undocumented

def _make_filename(self, id):

Build the filename from the session ID.