class documentation
class SessionProcurer: (source)
Implements interfaces: klein.interfaces.ISessionProcurer
A SessionProcurer
procures a session from a request and a store.
Method | procure |
Retrieve a session using whatever technique is necessary. |
Instance Variable | _cookie |
If set, the domain name to restrict the session cookie to. |
Instance Variable | _cookie |
If set, the URL path to restrict the session cookie to. |
Instance Variable | _insecure |
The name of the cookie to use for sessions not protected with TLS (i.e. HTTP). |
Instance Variable | _insecure |
The name of the HTTP header to try to extract a session token from; API clients should use this header, rather than a cookie. |
Instance Variable | _max |
The maximum age (in seconds) of the session cookie. |
Instance Variable | _secure |
The name of the cookie to use for sessions protected with TLS (i.e. HTTPS). |
Instance Variable | _secure |
The name of the HTTPS header to try to extract a session token from; API clients should use this header, rather than a cookie. |
Instance Variable | _set |
Automatically request that the session store create a session if one is not already associated with the request and the request is a GET. |
Instance Variable | _store |
The session store to procure a session from. |
Retrieve a session using whatever technique is necessary.
If the request already identifies an existing session in the store, retrieve it. If not, create a new session and retrieve that.
Parameters | |
request:IRequest | The request to procure a session from. |
forcebool | Even if the request was transmitted securely (i.e. over HTTPS), retrieve the session that would be used by the same browser if it were sending an insecure (i.e. over HTTP) request; by default, this is False, and the session's security will match that of the request. |
Returns | |
Any | a
|
The name of the HTTP header to try to extract a session token from; API clients should use this header, rather than a cookie.
The name of the HTTPS header to try to extract a session token from; API clients should use this header, rather than a cookie.