class SessionStore(SessionBase): (source)
Known subclasses: django.contrib.sessions.backends.cached_db.SessionStore
Implement database session store.
Class Method | clear |
Remove expired sessions from the session store. |
Class Method | get |
Undocumented |
Method | __init__ |
Undocumented |
Method | create |
Create a new session instance. Guaranteed to create a new object with a unique key and will have saved the result once (with empty data) before the method returns. |
Method | create |
Return a new instance of the session model object, which represents the current session state. Intended to be used for saving the session data to the database. |
Method | delete |
Delete the session data under this key. If the key is None, use the current session key value. |
Method | exists |
Return True if the given session_key already exists. |
Method | load |
Load the session data and return a dictionary. |
Method | save |
Save the current session data to the database. If 'must_create' is True, raise a database error if the saving operation doesn't create a new entry (as opposed to possibly updating an existing entry). |
Instance Variable | modified |
Undocumented |
Property | model |
Undocumented |
Method | _get |
Undocumented |
Instance Variable | _session |
Undocumented |
Inherited from SessionBase
:
Method | __contains__ |
Undocumented |
Method | __delitem__ |
Undocumented |
Method | __getitem__ |
Undocumented |
Method | __setitem__ |
Undocumented |
Method | clear |
Undocumented |
Method | cycle |
Create a new session key, while retaining the current session data. |
Method | decode |
Undocumented |
Method | delete |
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 |
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 |
Get the number of seconds until the session expires. |
Method | get |
Get session the expiry date (as a datetime object). |
Method | get |
Undocumented |
Method | has |
Undocumented |
Method | is |
Return True when there is no session_key and the session is empty. |
Method | items |
Undocumented |
Method | keys |
Undocumented |
Method | pop |
Undocumented |
Method | set |
Set a custom expiration for the session. ``value`` can be an integer, a Python ``datetime`` or ``timedelta`` object or ``None``. |
Method | set |
Undocumented |
Method | setdefault |
Undocumented |
Method | test |
Undocumented |
Method | update |
Undocumented |
Method | values |
Undocumented |
Constant | TEST |
Undocumented |
Constant | TEST |
Undocumented |
Class Variable | session |
Undocumented |
Instance Variable | accessed |
Undocumented |
Instance Variable | serializer |
Undocumented |
Property | key |
Undocumented |
Method | _get |
Return session key that isn't being used. |
Method | _get |
Undocumented |
Method | _get |
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 | _get |
Undocumented |
Method | _set |
Validate session key on assignment. Invalid values will set to None. |
Method | _validate |
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 |
Undocumented |
Class Variable | _session |
Undocumented |
Instance Variable | __session |
Undocumented |
Instance Variable | _session |
Undocumented |
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.
Create a new session instance. Guaranteed to create a new object with a unique key and will have saved the result once (with empty data) before the method returns.
Return a new instance of the session model object, which represents the current session state. Intended to be used for saving the session data to the database.
django.contrib.sessions.backends.cached_db.SessionStore
Delete the session data under this key. If the key is None, use the current session key value.
django.contrib.sessions.backends.cached_db.SessionStore
Return True if the given session_key already exists.
django.contrib.sessions.backends.cached_db.SessionStore
Load the session data and return a dictionary.
django.contrib.sessions.backends.cached_db.SessionStore
Save the current session data to the database. If 'must_create' is True, raise a database error if the saving operation doesn't create a new entry (as opposed to possibly updating an existing entry).