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 Summary |
|
__init__ (self,
conn,
table)
__init__ takes a psycopg connection to a PostgreSQL database,
together with an optional table name, 'table'. |
|
delete_session (self,
session)
Delete session from the database. |
|
load_session (self,
id,
default)
Load a pickled session from the database. |
|
save_session (self,
session)
Pickle session & save it into the database. |
|
setup (self)
Initialize the session store; e.g., create required database tables. |
Inherited from SessionStore |
|
delete_old_sessions (self,
minutes)
Delete all sessions that have not been modified for N minutes. |
|
has_session (self,
id)
Return true if the session exists in the store, else false. |
|
iter_sessions (self)
Return an iterable of (id, session) for all sessions in the store. |