pyweblib.session (version 0.2.2)
index
/usr/lib/python2.2/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
 
This module is distributed under the terms of the
GPL (GNU GENERAL PUBLIC LICENSE) Version 2
(see http://www.gnu.org/copyleft/gpl.html)
 
$Id: pyweblib.session.html,v 1.7 2002/02/01 12:57:21 michael Exp $

 
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
 
  
Method resolution order:
CleanUpThread
threading.Thread
threading._Verbose

Methods defined here:
__init__(self, sessionInstance, interval=60)
__repr__(self)
join(self, timeout=0.0)
run(self)
Thread function for cleaning up session database

Data and non-method functions defined here:
__doc__ = '\n Thread class for clean-up thread\n '
__module__ = 'pyweblib.session'

Methods inherited from threading.Thread:
_Thread__bootstrap = __bootstrap(self)
_Thread__delete = __delete(self)
_Thread__stop = __stop(self)
_set_daemon(self)
getName(self)
isAlive(self)
isDaemon(self)
setDaemon(self, daemonic)
setName(self, name)
start(self)

Data and non-method functions inherited from threading.Thread:
_Thread__initialized = 0

Methods inherited from threading._Verbose:
_note(self, format, *args)
 
class CorruptData(SessionException)
      Raised if data was corrupt, e.g. UnpicklingError occured
 
  
Method resolution order:
CorruptData
SessionException
exceptions.Exception

Methods defined here:
__str__(self)

Data and non-method functions defined here:
__doc__ = 'Raised if data was corrupt, e.g. UnpicklingError occured'
__module__ = 'pyweblib.session'

Methods inherited from SessionException:
__init__(self, *args)

Methods inherited from exceptions.Exception:
__getitem__(...)
 
class GenerateIDError(SessionException)
      Raised if generation of unique session ID failed.
 
  
Method resolution order:
GenerateIDError
SessionException
exceptions.Exception

Methods defined here:
__init__(self, maxtry)
__str__(self)

Data and non-method functions defined here:
__doc__ = 'Raised if generation of unique session ID failed.'
__module__ = 'pyweblib.session'

Methods inherited from exceptions.Exception:
__getitem__(...)
 
class KeyError(SessionException)
      Raised if session ID not found in session dictionary.
 
  
Method resolution order:
KeyError
SessionException
exceptions.Exception

Methods defined here:
__init__(self, session_id)
__str__(self)

Data and non-method functions defined here:
__doc__ = 'Raised if session ID not found in session dictionary.'
__module__ = 'pyweblib.session'

Methods inherited from exceptions.Exception:
__getitem__(...)
 
class SessionException(exceptions.Exception)
      Raised if
 
   Methods defined here:
__init__(self, *args)

Data and non-method functions defined here:
__doc__ = 'Raised if '
__module__ = 'pyweblib.session'

Methods inherited from exceptions.Exception:
__getitem__(...)
__str__(...)
 
class SessionExpired(SessionException)
      Raised if session is expired.
 
  
Method resolution order:
SessionExpired
SessionException
exceptions.Exception

Methods defined here:
__init__(self, timestamp, session_data)
__str__(self)

Data and non-method functions defined here:
__doc__ = 'Raised if session is expired.'
__module__ = 'pyweblib.session'

Methods inherited from exceptions.Exception:
__getitem__(...)
 
class SessionHijacked(SessionException)
      Raised if hijacking of session was detected.
 
  
Method resolution order:
SessionHijacked
SessionException
exceptions.Exception

Methods defined here:
__init__(self, failed_vars)
__str__(self)

Data and non-method functions defined here:
__doc__ = 'Raised if hijacking of session was detected.'
__module__ = 'pyweblib.session'

Methods inherited from exceptions.Exception:
__getitem__(...)
 
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={}, expireDeactivate=0, expireRemove=0, crossCheckVars=['\n List of environment variables assumed to be... 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 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 KeyError 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()
_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 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={})
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 and non-method functions defined here:
__doc__ = '\n The session class which handles storing and...\n in a dictionary-like sessiondict object.\n '
__module__ = 'pyweblib.session'
 
Data
             SESSION_crossCheckVars = ['\n List of environment variables assumed to be... 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.2/site-packages/pyweblib/session.pyc'
__name__ = 'pyweblib.session'
__version__ = '0.2.2'
prng = <whrandom.whrandom instance>