sessions.backends.base.SessionBase.pop()

pop(key, default=__not_given) Example: fav_color = request.session.pop('fav_color', 'blue')

sessions.backends.base.SessionBase.setdefault()

setdefault()

sessions.backends.base.SessionBase.set_expiry()

set_expiry(value) Sets the expiration time for the session. You can pass a number of different values: If value is an integer, the session will expire after that many seconds of inactivity. For example, calling request.session.set_expiry(300) would make the session expire in 5 minutes. If value is a datetime or timedelta object, the session will expire at that specific date/time. Note that datetime and timedelta values are only serializable if you are using the PickleSerializer. If value is

sessions.backends.base.SessionBase.set_test_cookie()

set_test_cookie() Sets a test cookie to determine whether the user’s browser supports cookies. Due to the way cookies work, you won’t be able to test this until the user’s next page request. See Setting test cookies below for more information.

sessions.backends.base.SessionBase.test_cookie_worked()

test_cookie_worked() Returns either True or False, depending on whether the user’s browser accepted the test cookie. Due to the way cookies work, you’ll have to call set_test_cookie() on a previous, separate page request. See Setting test cookies below for more information.

sessions.backends.base.SessionBase.__contains__()

__contains__(key) Example: 'fav_color' in request.session

sessions.backends.base.SessionBase.__delitem__()

__delitem__(key) Example: del request.session['fav_color']. This raises KeyError if the given key isn’t already in the session.

sessions.backends.base.SessionBase.__getitem__()

__getitem__(key) Example: fav_color = request.session['fav_color']

sessions.backends.base.SessionBase.__setitem__()

__setitem__(key, value) Example: request.session['fav_color'] = 'blue'

sessions.backends.cached_db.SessionStore

class backends.cached_db.SessionStore Implements cached database-backed session store. cache_key_prefix New in Django 1.9. A prefix added to a session key to build a cache key string.