A persistent session manager for Quixote.
Method | __init__ |
__init__ takes a session store instance and (optionally) the session class to use for storing session information. (This defaults to Session.Session ). |
Method | __repr__ |
Undocumented |
Method | clear |
Clear any residual session information for this request. |
Method | expire |
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. |
Method | finish |
Called near the end of a failed request (i.e. a exception that was not a PublisherError was raised. |
Method | finish |
Called near the end of each successful request. Not called if there were any errors processing the request. |
Method | get |
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. |
Method | has |
Return true if a session identified by 'session_id' exists in the session manager. |
Method | has |
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. |
Method | maintain |
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... |
Method | new |
Return a new session object, ie. an instance of the session_class class passed to the constructor (defaults to Session ). |
Method | revoke |
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. |
Method | set |
Ensure that a session cookie with value 'session_id' will be returned to the client via the response object. |
Method | start |
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. |
Constant | ACCESS |
Undocumented |
Instance Variable | expired |
Undocumented |
Instance Variable | session |
Undocumented |
Instance Variable | store |
Undocumented |
Method | _create |
Undocumented |
Method | _get |
Find the ID of the current session by looking for the session cookie in the request. Return None if no such cookie or the cookie has been expired, otherwise return the cookie's value. |
Method | _make |
Undocumented |
Method | _set |
Undocumented |
__init__
takes a session store instance and (optionally) the
session class to use for storing session information. (This defaults to Session.Session
).
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.
Called near the end of each successful request. Not called if there were any errors processing the request.
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()
](#section-14).
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 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.
Return a new session object, ie. an instance of the session_class
class passed to the constructor (defaults to Session
).
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.
Ensure that a session cookie with value 'session_id' will be returned to the client via the response object.
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.