Package cherrypy :: Package lib :: Module sessions :: Class Session
[hide private]
[frames] | no frames]

Class Session

source code

object --+
         |
        Session
Known Subclasses:
FileSession, PostgresqlSession, RamSession

A CherryPy dict-like Session object (one per request).

clean_freq [= 5]:
    The poll rate for expired session cleanup in minutes.

clean_thread [= None]:
    Class-level PerpetualTimer which calls self.clean_up.

id [= None]:
    The current session ID.

loaded [= False]:
    If True, data has been retrieved from storage. This should happen
    automatically on the first attempt to access session data.

locked [= False]:
    If True, this session instance has exclusive read/write access
    to session data.

timeout [= 60]:
    Number of minutes after which to delete session data.



Nested Classes [hide private]
  __metaclass__
Metaclass for declaring docstrings for class attributes.
Instance Methods [hide private]
 
__init__(self, id=None, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
clean_up(self)
Clean up expired sessions.
source code
 
generate_id(self)
Return a new session id.
source code
 
save(self)
Save session data.
source code
 
load(self)
Copy stored session data into this session instance.
source code
 
delete(self)
Delete stored session data.
source code
 
__getitem__(self, key) source code
 
__setitem__(self, key, value) source code
 
__delitem__(self, key) source code
 
pop(self, key, default=object()) source code
 
__contains__(self, key) source code
 
has_key(self, key) source code
 
get(self, key, default=None) source code
 
update(self, d) source code
 
setdefault(self, key, default=None) source code
 
clear(self) source code
 
keys(self) source code
 
items(self) source code
 
values(self) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Methods [hide private]
 
clean_interrupt(cls)
Stop the expired-session cleaning timer.
source code
Class Variables [hide private]
  id = None
  id__doc = "The current session ID."
  timeout = 60
  timeout__doc = "Number of minutes after which to delete sessio...
  locked = False
  locked__doc = ...
  loaded = False
  loaded__doc = ...
  clean_thread = None
  clean_thread__doc = "Class-level PerpetualTimer which calls se...
  clean_freq = 5
  clean_freq__doc = "The poll rate for expired session cleanup i...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, id=None, **kwargs)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

Class Variable Details [hide private]

timeout__doc

Value:
"Number of minutes after which to delete session data."

locked__doc

Value:
"""
    If True, this session instance has exclusive read/write access
    to session data."""

loaded__doc

Value:
"""
    If True, data has been retrieved from storage. This should happen
    automatically on the first attempt to access session data."""

clean_thread__doc

Value:
"Class-level PerpetualTimer which calls self.clean_up."

clean_freq__doc

Value:
"The poll rate for expired session cleanup in minutes."