class documentation

class SessionStore(SessionBase): (source)

View In Hierarchy

Undocumented

Class Method clear_expired Remove expired sessions from the session store.
Method create To create a new key, set the modified flag so that the cookie is set on the client for the current request.
Method cycle_key Keep the same data but with a new key. Call save() and it will automatically save a cookie with a new key at the end of the request.
Method delete To delete, clear the session key and the underlying data structure and set the modified flag so that the cookie is set on the client for the current request.
Method exists This method makes sense when you're talking to a shared resource, but it doesn't matter when you're storing the information in the client's cookie.
Method load Load the data from the key itself instead of fetching from some external data store. Opposite of _get_session_key(), raise BadSignature if signature fails.
Method save To save, get the session key as a securely signed string and then set the modified flag so that the cookie is set on the client for the current request.
Instance Variable modified Undocumented
Method _get_session_key Instead of generating a random string, generate a secure url-safe base64-encoded string of data as our session key.
Instance Variable _session_cache Undocumented
Instance Variable _session_key Undocumented

Inherited from SessionBase:

Method __contains__ Undocumented
Method __delitem__ Undocumented
Method __getitem__ Undocumented
Method __init__ Undocumented
Method __setitem__ Undocumented
Method clear Undocumented
Method decode Undocumented
Method delete_test_cookie Undocumented
Method encode Return the given session dictionary serialized and encoded as a string.
Method flush Remove the current session data from the database and regenerate the key.
Method get Undocumented
Method get_expire_at_browser_close Return ``True`` if the session is set to expire when the browser closes, and ``False`` if there's an expiry date. Use ``get_expiry_date()`` or ``get_expiry_age()`` to find the actual expiry date/age, if there is one.
Method get_expiry_age Get the number of seconds until the session expires.
Method get_expiry_date Get session the expiry date (as a datetime object).
Method get_session_cookie_age Undocumented
Method has_key Undocumented
Method is_empty Return True when there is no session_key and the session is empty.
Method items Undocumented
Method keys Undocumented
Method pop Undocumented
Method set_expiry Set a custom expiration for the session. ``value`` can be an integer, a Python ``datetime`` or ``timedelta`` object or ``None``.
Method set_test_cookie Undocumented
Method setdefault Undocumented
Method test_cookie_worked Undocumented
Method update Undocumented
Method values Undocumented
Constant TEST_COOKIE_NAME Undocumented
Constant TEST_COOKIE_VALUE Undocumented
Class Variable session_key Undocumented
Instance Variable accessed Undocumented
Instance Variable serializer Undocumented
Property key_salt Undocumented
Method _get_new_session_key Return session key that isn't being used.
Method _get_or_create_session_key Undocumented
Method _get_session Lazily load session from storage (unless "no_load" is True, when only an empty dict is stored) and store it in the current instance.
Method _set_session_key Validate session key on assignment. Invalid values will set to None.
Method _validate_session_key Key must be truthy and at least 8 characters long. 8 characters is an arbitrary lower bound for some minimal key security.
Class Variable __not_given Undocumented
Class Variable _session Undocumented
Instance Variable __session_key Undocumented
@classmethod
def clear_expired(cls): (source)

Remove expired sessions from the session store. If this operation isn't possible on a given backend, it should raise NotImplementedError. If it isn't necessary, because the backend has a built-in expiration mechanism, it should be a no-op.

def create(self): (source)

To create a new key, set the modified flag so that the cookie is set on the client for the current request.

def cycle_key(self): (source)

Keep the same data but with a new key. Call save() and it will automatically save a cookie with a new key at the end of the request.

def delete(self, session_key=None): (source)

To delete, clear the session key and the underlying data structure and set the modified flag so that the cookie is set on the client for the current request.

def exists(self, session_key=None): (source)

This method makes sense when you're talking to a shared resource, but it doesn't matter when you're storing the information in the client's cookie.

def load(self): (source)

Load the data from the key itself instead of fetching from some external data store. Opposite of _get_session_key(), raise BadSignature if signature fails.

def save(self, must_create=False): (source)

To save, get the session key as a securely signed string and then set the modified flag so that the cookie is set on the client for the current request.

def _get_session_key(self): (source)

Instead of generating a random string, generate a secure url-safe base64-encoded string of data as our session key.