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

Class DirectorySessionStore

SessionStore --+
               |
              DirectorySessionStore


Store sessions in individual files within a directory.


Method Summary
  __init__(self, directory, create)
__init__ takes a directory name, with an option to create it if it's not already there.
  delete_old_sessions(self, minutes)
Delete all sessions that have not been modified for N minutes.
  delete_session(self, session)
Delete the session file.
  load_session(self, id, default)
Load the pickled session from a file.
  save_session(self, session)
Pickle the session and save it into a file.
    Inherited from SessionStore
  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.
  setup(self)
Initialize the session store; e.g., create required database tables.

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

Method Details

__init__(self, directory, create=False)
(Constructor)

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

delete_old_sessions(self, minutes)

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)
Overrides:
session2.store.SessionStore.SessionStore.delete_old_sessions

delete_session(self, session)

Delete the session file.

Overrides:
session2.store.SessionStore.SessionStore.delete_session

load_session(self, id, default=None)

Load the pickled session from a file.

Overrides:
session2.store.SessionStore.SessionStore.load_session

save_session(self, session)

Pickle the session and save it into a file.

Overrides:
session2.store.SessionStore.SessionStore.save_session

Class Variable Details

is_multiprocess_safe

Type:
bool
Value:
False                                                                  

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