class documentation

class PostgresSessionStore(SessionStore):

Constructor: PostgresSessionStore(conn, table)

View In Hierarchy

Store pickled sessions in an SQL database.

See the create() function for the table definition.

This implementation has been tested with psycopg. It should work with any DB-API module that supports connection.rollback() and "%(var)s" substitution style, e.g. psycopg.

Method __init__ __init__ takes a psycopg connection to a PostgreSQL database, together with an optional table name, 'table'.
Method delete_session Delete session from the database.
Method load_session Load a pickled session from the database.
Method save_session Pickle session & save it into the database.
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.
Class Variable is_multiprocess_safe Undocumented
Class Variable is_thread_safe Undocumented
Instance Variable conn Undocumented
Instance Variable table Undocumented

Inherited from SessionStore:

Method delete_old_sessions Delete all sessions that have not been modified for N minutes. The default implementation does nothing, meaning the store cannot delete old sessions.
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.
def __init__(self, conn, table=None):

__init__ takes a psycopg connection to a PostgreSQL database, together with an optional table name, 'table'.

def delete_session(self, session):

Delete session from the database.

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

Load a pickled session from the database.

def save_session(self, session):

Pickle session & save it into the database.

def setup(self):

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.

This method is never called by the session manager; it's for your application setup program.

is_multiprocess_safe: bool =
is_thread_safe: bool =
conn =

Undocumented

table =

Undocumented