Package session2 :: Module Session :: Class Session
[frames | no frames]

Class Session

Known Subclasses:
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.

Instance attributes:

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__(self, id)
__init__ -- called only by SessionManager.SessionManager.
  __repr__(self)
  __str__(self)
  dump(self, file, header, deep)
  get_access_age(self, _now)
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)
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.
  get_user(self)
  has_info(self)
() -> boolean
  set_user(self, user)
  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.

Method Details

__init__(self, id)
(Constructor)

__init__ -- called only by SessionManager.SessionManager.

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.


Generated by Epydoc 2.1 on Sat Feb 4 16:40:10 2006 http://epydoc.sf.net