Package session2 :: Package store :: Module MySQLSessionStore :: Class MySQLSessionStore
[frames | no frames]

Class MySQLSessionStore

SessionStore --+
               |
              MySQLSessionStore


Method Summary
  __init__(self, conn, table)
__init__ takes a MySQLdb connection object, together with an optional 'table' argument containing the name of the table to use.
  delete_old_sessions(self, minutes)
Delete all sessions that have not been modified for N minutes.
  delete_session(self, session)
Delete the session in the store.
  iter_sessions(self)
Return an iterable of (id, session) for all sessions in the store.
  load_session(self, id, default)
Return the session if it exists, else return 'default'.
  save_session(self, session)
Save the session in the store.
  setup(self)
Initialize the session store; e.g., create required database tables.
    Inherited from SessionStore
  has_session(self, id)
Return true if the session exists in the store, else false.

Class Variable Summary
bool is_multiprocess_safe = True
bool is_thread_safe = False
int pickle_protocol = 2                                                                     

Method Details

__init__(self, conn, table=None)
(Constructor)

__init__ takes a MySQLdb connection object, together with an optional 'table' argument containing the name of the table to use.

delete_old_sessions(self, minutes)

Delete all sessions that have not been modified for N minutes. The default implementation does nothing, meaning the store cannot delete old sessions.

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

Overrides:
session2.store.SessionStore.SessionStore.delete_old_sessions (inherited documentation)

delete_session(self, session)

Delete the session in the store.

Overrides:
session2.store.SessionStore.SessionStore.delete_session (inherited documentation)

iter_sessions(self)

Return an iterable of (id, session) for all sessions in the store.

This method is never called by the session manager; it's for admin applications that want to browse the sessions.

Overrides:
session2.store.SessionStore.SessionStore.iter_sessions (inherited documentation)

load_session(self, id, default=None)

Return the session if it exists, else return 'default'.

Overrides:
session2.store.SessionStore.SessionStore.load_session (inherited documentation)

save_session(self, session)

Save the session in the store.

Overrides:
session2.store.SessionStore.SessionStore.save_session (inherited documentation)

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.

Overrides:
session2.store.SessionStore.SessionStore.setup (inherited documentation)

Class Variable Details

is_multiprocess_safe

Type:
bool
Value:
True                                                                   

is_thread_safe

Type:
bool
Value:
False                                                                  

pickle_protocol

Type:
int
Value:
2                                                                     

Generated by Epydoc 2.1 on Sat Feb 4 16:40:10 2006 http://epydoc.sf.net