Home | Trees | Index | Help |
|
---|
Package session2 :: Module Session :: Class Session |
|
DictSession
Holds information about the current session. The only information that is likely to be useful to applications is the 'user' attribute, which applications can use as they please.
the session ID (generated by SessionManager and used as the value of the session cookie)
an object to identify the human being on the other end of the line. It's up to you whether to store just a string in 'user', or some more complex data structure or object.
IP address of user owning this session (only set when the session is created)
_creation_time : float
two ways of keeping track of the "age" of the session. Note that '__access_time' is maintained by the SessionManager that owns this session, using _set_access_time().
Feel free to access 'id' and 'user' directly, but do not modify 'id'. The preferred way to set 'user' is with the set_user() method (which you might want to override for type-checking).
Note: this class may be split into a SimpleSession superclass and a Session subclass in the future.
Method Summary | |
---|---|
__init__ -- called only by SessionManager.SessionManager . | |
__repr__(self)
| |
__str__(self)
| |
dump(self,
file,
header,
deep)
| |
Return the number of seconds since session was last accessed. | |
Return the time that this session was last accessed (seconds since epoch). | |
Return the number of seconds since session was created. | |
Return the time that this session was created (seconds since epoch). | |
Return the IP address (dotted-quad string) that made the initial request in this session. | |
get_user(self)
| |
() -> boolean | |
set_user(self,
user)
| |
Called near the beginning of each request: after the HTTPRequest object has been built, but before we traverse the URL or call the callable object found by URL traversal. |
Method Details |
---|
__init__(self,
id)
|
get_access_age(self, _now=None)Return the number of seconds since session was last accessed. |
get_access_time(self)Return the time that this session was last accessed (seconds since epoch). |
get_creation_age(self, _now=None)Return the number of seconds since session was created. |
get_creation_time(self)Return the time that this session was created (seconds since epoch). |
get_remote_address(self)Return the IP address (dotted-quad string) that made the initial request in this session. |
has_info(self)() -> boolean Return true if this session contains any information that must be saved. |
start_request(self)Called near the beginning of each request: after the HTTPRequest object has been built, but before we traverse the URL or call the callable object found by URL traversal. |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon Oct 24 19:07:08 2005 | http://epydoc.sf.net |