pyweblib.session (version 0.2.1)
index
/usr/lib/python2.1/site-packages/pyweblib/session.py

pyweblib.session - server-side web session handling
(C) 2001 by Michael Stroeder <michael@stroeder.com>
 
This module implements server side session handling stored in
arbitrary string-keyed dictionary objects

 
Modules
            
pickle
threading
time
whrandom

 
Classes
            
exceptions.Exception
SessionException
CorruptData
GenerateIDError
KeyError
SessionExpired
SessionHijacked
threading.Thread(threading._Verbose)
CleanUpThread
WebSession

 
class CleanUpThread(threading.Thread)
      Thread class for clean-up thread
 
  
_Thread__bootstrap = __bootstrap(self) from threading.Thread
_Thread__delete = __delete(self) from threading.Thread
_Thread__stop = __stop(self) from threading.Thread
__init__(self, cgiSession, interval=60)
__repr__(self) from threading.Thread
_note(self, format, *args) from threading._Verbose
_set_daemon(self) from threading.Thread
getName(self) from threading.Thread
isAlive(self) from threading.Thread
isDaemon(self) from threading.Thread
join(self, timeout=None) from threading.Thread
run(self)
Thread function for cleaning up session database
setDaemon(self, daemonic) from threading.Thread
setName(self, name) from threading.Thread
start(self) from threading.Thread

 
class CorruptData(SessionException)
      Raised if data was corrupt, e.g. UnpicklingError occured
 
  
__getitem__(...) from exceptions.Exception
__init__(self, *args) from SessionException
__str__(self)

 
class GenerateIDError(SessionException)
      Raised if generation of unique session ID failed.
 
  
__getitem__(...) from exceptions.Exception
__init__(self, maxtry)
__str__(self)

 
class KeyError(SessionException)
      Raised if session ID not found in session dictionary.
 
  
__getitem__(...) from exceptions.Exception
__init__(self, session_id)
__str__(self)

 
class SessionException(exceptions.Exception)
      Raised if
 
  
__getitem__(...) from exceptions.Exception
__init__(self, *args)
__str__(...) from exceptions.Exception

 
class SessionExpired(SessionException)
      Raised if session is expired.
 
  
__getitem__(...) from exceptions.Exception
__init__(self, timestamp, session_data)
__str__(self)

 
class SessionHijacked(SessionException)
      Raised if hijacking of session was detected.
 
  
__getitem__(...) from exceptions.Exception
__init__(self, failed_vars)
__str__(self)

 
class WebSession
      The session class which handles storing and retrieving of session data
in a dictionary-like sessiondict object.
 
  
__init__(self, dictobj={}, expire_relogin=0, expire_remove=0, crosscheckvars=['\n List of environment variables assumed to be c...gh a network of web proxy siblings.\n REMOTE_ADDR', 'REMOTE_HOST', 'REMOTE_IDENT', 'REMOTE_USER', 'FORWARDED_FOR', 'HTTP_X_FORWARDED_FOR', 'HTTP_USER_AGENT', 'HTTP_ACCEPT_CHARSET', 'SSL_SESSION_ID', 'SSL_CLIENT_V_START', 'SSL_CLIENT_V_END', 'SSL_CLIENT_I_DN', 'SSL_CLIENT_IDN', 'SSL_CLIENT_S_DN', 'SSL_CLIENT_SDN', 'SSL_CLIENT_M_SERIAL', 'SSL_CLIENT_CERT_SERIAL'])
dictobj             has to be a instance of a dictionary-like
                    object (e.g. derived from UserDict)
expire_relogin      amount of time (secs) after which a session
                    expires and a SessionExpired exception is
                    raised which contains the session data.
expire_remove       amount of time (secs) after which a session
                    expires and the session data is silently deleted.
                    A KeyError exception is raised in this case.
crosscheckvars      list of keys of variables cross-checked for each
                    retrieval of session data in retrieveSession()
_crosscheckSessionEnv(self, stored_env, current_env)
Returns a list of keys of items which differ in
stored_env and current_env.
_generateCrosscheckEnv(self, current_env)
Generate a dictionary of env vars for session cross-checking
_generateSessionID(self, maxtry=1)
Generate a new random and unique session id string
cleanUp(self)
Search for expired session entries and remove them
close(self)
Call close() if self.sessiondict has .close() method
deleteSession(self, session_id)
Delete session_data referenced by session_id.
newSession(self, env={})
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

 
Data
             SESSION_CROSSCHECKVARS = ['\n List of environment variables assumed to be c...gh a network of web proxy siblings.\n REMOTE_ADDR', 'REMOTE_HOST', 'REMOTE_IDENT', 'REMOTE_USER', 'FORWARDED_FOR', 'HTTP_X_FORWARDED_FOR', 'HTTP_USER_AGENT', 'HTTP_ACCEPT_CHARSET', 'SSL_SESSION_ID', 'SSL_CLIENT_V_START', 'SSL_CLIENT_V_END', 'SSL_CLIENT_I_DN', 'SSL_CLIENT_IDN', 'SSL_CLIENT_S_DN', 'SSL_CLIENT_SDN', 'SSL_CLIENT_M_SERIAL', 'SSL_CLIENT_CERT_SERIAL']
__file__ = '/usr/lib/python2.1/site-packages/pyweblib/session.pyc'
__name__ = 'pyweblib.session'
__version__ = '0.2.1'
prng = <whrandom.whrandom instance>