sessions.backends.base.SessionBase.clear_expired()

clear_expired() Removes expired sessions from the session store. This class method is called by clearsessions.

sessions.backends.base.SessionBase.cycle_key()

cycle_key() Creates a new session key while retaining the current session data. django.contrib.auth.login() calls this method to mitigate against session fixation.

sessions.backends.base.SessionBase.delete_test_cookie()

delete_test_cookie() Deletes the test cookie. Use this to clean up after yourself.

sessions.backends.base.SessionBase.flush()

flush() Deletes the current session data from the session and deletes the session cookie. This is used if you want to ensure that the previous session data can’t be accessed again from the user’s browser (for example, the django.contrib.auth.logout() function calls it).

sessions.backends.base.SessionBase.get()

get(key, default=None) Example: fav_color = request.session.get('fav_color', 'red')

sessions.backends.base.SessionBase.get_expire_at_browser_close()

get_expire_at_browser_close() Returns either True or False, depending on whether the user’s session cookie will expire when the user’s Web browser is closed.

sessions.backends.base.SessionBase.get_expiry_age()

get_expiry_age() Returns the number of seconds until this session expires. For sessions with no custom expiration (or those set to expire at browser close), this will equal SESSION_COOKIE_AGE. This function accepts two optional keyword arguments: modification: last modification of the session, as a datetime object. Defaults to the current time. expiry: expiry information for the session, as a datetime object, an int (in seconds), or None. Defaults to the value stored in the session by set_

sessions.backends.base.SessionBase.get_expiry_date()

get_expiry_date() Returns the date this session will expire. For sessions with no custom expiration (or those set to expire at browser close), this will equal the date SESSION_COOKIE_AGE seconds from now. This function accepts the same keyword arguments as get_expiry_age().

sessions.backends.base.SessionBase.items()

items()

sessions.backends.base.SessionBase.keys()

keys()