| |
- exceptions.Exception(exceptions.BaseException)
-
- SessionException
-
- BadSessionId
- CorruptData
- GenerateIDError
- InvalidSessionId
- MaxSessionCountExceeded
- SessionExpired
- SessionHijacked
- WebSession
- threading.Thread(threading._Verbose)
-
- CleanUpThread
class CleanUpThread(threading.Thread) |
|
Thread class for clean-up thread |
|
- Method resolution order:
- CleanUpThread
- threading.Thread
- threading._Verbose
- __builtin__.object
Methods defined here:
- __init__(self, sessionInstance, interval=60)
- __repr__(self)
- join(self, timeout=0.0)
- run(self)
- Thread function for cleaning up session database
Methods inherited from threading.Thread:
- getName(self)
- isAlive(self)
- Return whether the thread is alive.
This method returns True just before the run() method starts until just
after the run() method terminates. The module function enumerate()
returns a list of all alive threads.
- isDaemon(self)
- is_alive = isAlive(self)
- Return whether the thread is alive.
This method returns True just before the run() method starts until just
after the run() method terminates. The module function enumerate()
returns a list of all alive threads.
- setDaemon(self, daemonic)
- setName(self, name)
- start(self)
- Start the thread's activity.
It must be called at most once per thread object. It arranges for the
object's run() method to be invoked in a separate thread of control.
This method will raise a RuntimeError if called more than once on the
same thread object.
Data descriptors inherited from threading.Thread:
- daemon
- A boolean value indicating whether this thread is a daemon thread (True) or not (False).
This must be set before start() is called, otherwise RuntimeError is
raised. Its initial value is inherited from the creating thread; the
main thread is not a daemon thread and therefore all threads created in
the main thread default to daemon = False.
The entire Python program exits when no alive non-daemon threads are
left.
- ident
- Thread identifier of this thread or None if it has not been started.
This is a nonzero integer. See the thread.get_ident() function. Thread
identifiers may be recycled when a thread exits and another thread is
created. The identifier is available even after the thread has exited.
- name
- A string used for identification purposes only.
It has no semantics. Multiple threads may be given the same name. The
initial name is set by the constructor.
Data descriptors inherited from threading._Verbose:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class WebSession |
|
The session class which handles storing and retrieving of session data
in a dictionary-like sessiondict object. |
|
Methods defined here:
- __init__(self, dictobj=None, expireDeactivate=0, expireRemove=0, crossCheckVars=None, maxSessionCount=None, sessionIDLength=12, sessionIDChars=None)
- dictobj
has to be a instance of a dictionary-like object
(e.g. derived from UserDict or shelve)
expireDeactivate
amount of time (secs) after which a session
expires and a SessionExpired exception is
raised which contains the session data.
expireRemove
Amount of time (secs) after which a session
expires and the session data is silently deleted.
A InvalidSessionId exception is raised in this case if
the application trys to access the session ID again.
crossCheckVars
List of keys of variables cross-checked for each
retrieval of session data in retrieveSession(). If None
SESSION_CROSSCHECKVARS is used.
maxSessionCount
Maximum number of valid sessions. This affects
behaviour of retrieveSession() which raises.
None means unlimited number of sessions.
sessionIDLength
Exact integer length of the session ID generated
sessionIDChars
String containing the valid chars for session IDs
(if this is zero-value the default is SESSION_ID_CHARS)
- cleanUp(self)
- Search for expired session entries and delete them.
Returns integer counter of deleted sessions as result.
- close(self)
- Call close() if self.sessiondict has .close() method
- deleteSession(self, session_id)
- Delete session_data referenced by session_id.
- newSession(self, env=None)
- Store session data under session id
- retrieveSession(self, session_id, env={})
- Retrieve session data
- storeSession(self, session_id, session_data)
- Store session_data under session_id.
- sync(self)
- Call sync if self.sessiondict has .sync() method
| |