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

Class SessionManager


A persistent session manager for Quixote.


Method Summary
  __init__(self, store_obj, session_class)
__init__ takes a session store instance and (optionally) the session class to use for storing session information.
  __repr__(self)
  clear_session(self, request)
Clear any residual session information for this request.
  expire_session(self)
Expire the current session, ie.
  finish_failed_request(self)
Called near the end of a failed request (i.e.
  finish_successful_request(self)
Called near the end of each successful request.
  get_session(self)
() -> Session
  has_session(self, session_id)
(session_id : string) -> boolean
  has_session_cookie(self, must_exist)
(must_exist : boolean = false) -> bool
  maintain_session(self, session)
(session : Session) -> bool
  new_session(self, id)
(id : string) -> Session
  revoke_session_cookie(self)
Remove the session cookie from the remote user's session by resetting the value and maximum age in the response object.
  set_session_cookie(self, session_id)
(session_id : string)
  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.

Class Variable Summary
int ACCESS_TIME_RESOLUTION = 1                                                                     

Method Details

__init__(self, store_obj, session_class=<class session2.Session.Session at 0x4034b1ac>)
(Constructor)

__init__ takes a session store instance and (optionally) the session class to use for storing session information. (This defaults to Session.Session).

clear_session(self, request)

Clear any residual session information for this request.

expire_session(self)

Expire the current session, ie. revoke the session cookie from the client, remove the session object from the current request, and list it for permanent removal.

finish_failed_request(self)

Called near the end of a failed request (i.e. a exception that was not a PublisherError was raised.

finish_successful_request(self)

Called near the end of each successful request. Not called if there were any errors processing the request.

get_session(self)

() -> Session

Fetch or create a session object for the current session, and return it. If a session cookie is found in the HTTP request object, use it to look up and return an existing session object. If no session cookie is found, create a new session.

Note that this method does not cause the new session to be stored in the session manager, nor does it drop a session cookie on the user. Those are both the responsibility of finish_successful_request().

has_session(self, session_id)

(session_id : string) -> boolean

Return true if a session identified by 'session_id' exists in the session manager.

has_session_cookie(self, must_exist=False)

(must_exist : boolean = false) -> bool

Return true if the request already has a cookie identifying a session object. If 'must_exist' is true, the cookie must correspond to a currently existing session; otherwise (the default), we just check for the existence of the session cookie and don't inspect its content at all.

maintain_session(self, session)

(session : Session) -> bool

Maintain session information. This method is called after servicing an HTTP request, just before the response is returned. If a session contains information a cookie is dropped on the client and True is returned. If not, the session is forcibly expired and False is returned.

new_session(self, id)

(id : string) -> Session

Return a new session object, ie. an instance of the session_class class passed to the constructor (defaults to Session).

revoke_session_cookie(self)

Remove the session cookie from the remote user's session by resetting the value and maximum age in the response object. Also remove the cookie from the request so that further processing of this request does not see the cookie's revoked value.

set_session_cookie(self, session_id)

(session_id : string)

Ensure that a session cookie with value 'session_id' will be returned to the client via the response object.

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.


Class Variable Details

ACCESS_TIME_RESOLUTION

Type:
int
Value:
1                                                                     

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