class SessionBase:
Known subclasses: django.contrib.sessions.backends.db.SessionStore
, django.contrib.sessions.backends.cache.SessionStore
, django.contrib.sessions.backends.file.SessionStore
, django.contrib.sessions.backends.signed_cookies.SessionStore
Class Method | clear_expired |
Remove expired sessions from the session store. |
Method | __contains__ |
Undocumented |
Method | __delitem__ |
Undocumented |
Method | __getitem__ |
Undocumented |
Method | __setitem__ |
Undocumented |
Method | clear |
Undocumented |
Method | cycle_key |
Create a new session key, while retaining the current session data. |
Method | delete_test_cookie |
Undocumented |
Method | flush |
Remove the current session data from the database and regenerate the key. |
Method | get |
Undocumented |
Method | get_expire_at_browser_close |
No summary |
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 | 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 |
Constant | TEST_COOKIE_NAME |
Undocumented |
Constant | TEST_COOKIE_VALUE |
Undocumented |
Method | __init__ |
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 | _get_session_key |
Undocumented |
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. |
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 | decode |
Undocumented |
Method | delete |
Delete the session data under this key. If the key is None, use the current session key value. |
Method | encode |
Return the given session dictionary serialized and encoded as a string. |
Method | exists |
Return True if the given session_key already exists. |
Method | has_key |
Undocumented |
Method | is_empty |
Return True when there is no session_key and the session is empty. |
Method | load |
Load the session data and return a dictionary. |
Method | save |
Save the session data. If 'must_create' is True, create a new session object (or raise CreateError). Otherwise, only update an existing object and don't create one (raise UpdateError if needed). |
Method | update |
Undocumented |
Method | values |
Undocumented |
Class Variable | __not_given |
Undocumented |
Class Variable | _session |
Undocumented |
Class Variable | session_key |
Undocumented |
Instance Variable | __session_key |
Undocumented |
Instance Variable | _session_cache |
Undocumented |
Instance Variable | _session_key |
Undocumented |
Instance Variable | accessed |
Undocumented |
Instance Variable | modified |
Undocumented |
Instance Variable | serializer |
Undocumented |
Property | key_salt |
Undocumented |
django.contrib.sessions.backends.db.SessionStore
, django.contrib.sessions.backends.cache.SessionStore
, django.contrib.sessions.backends.file.SessionStore
, django.contrib.sessions.backends.signed_cookies.SessionStore
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.
django.contrib.sessions.backends.cached_db.SessionStore
Get the number of seconds until the session expires.
Optionally, this function accepts modification
and expiry
keyword
arguments specifying the modification and expiry of the session.
Get session the expiry date (as a datetime object).
Optionally, this function accepts modification
and expiry
keyword
arguments specifying the modification and expiry of the session.
Set a custom expiration for the session. value can be an integer, a Python datetime or timedelta object or None.
If value is an integer, the session will expire after that many seconds of inactivity. If set to 0 then the session will expire on browser close.
If value is a datetime or timedelta object, the session will expire at that specific future time.
If value is None, the session uses the global session expiry policy.
django.contrib.sessions.backends.db.SessionStore
, django.contrib.sessions.backends.cache.SessionStore
, django.contrib.sessions.backends.file.SessionStore
, django.contrib.sessions.backends.signed_cookies.SessionStore
django.contrib.sessions.backends.db.SessionStore
, django.contrib.sessions.backends.cache.SessionStore
, django.contrib.sessions.backends.file.SessionStore
, django.contrib.sessions.backends.signed_cookies.SessionStore
django.contrib.sessions.backends.db.SessionStore
, django.contrib.sessions.backends.cache.SessionStore
, django.contrib.sessions.backends.file.SessionStore
, django.contrib.sessions.backends.signed_cookies.SessionStore
django.contrib.sessions.backends.db.SessionStore
, django.contrib.sessions.backends.cache.SessionStore
, django.contrib.sessions.backends.file.SessionStore
, django.contrib.sessions.backends.signed_cookies.SessionStore
django.contrib.sessions.backends.db.SessionStore
, django.contrib.sessions.backends.cache.SessionStore
, django.contrib.sessions.backends.file.SessionStore
, django.contrib.sessions.backends.signed_cookies.SessionStore