1
0
mirror of https://github.com/django/django.git synced 2025-03-13 10:50:55 +00:00

[1.10.x] Fixed #26503 -- Removed an outdated example from session docs.

Backport of 698c8dfc2a5c5865a8bb163c1ae70b75d53e6415 from master
This commit is contained in:
Berker Peksag 2016-05-31 04:21:00 -07:00 committed by Tim Graham
parent c2dde7561a
commit ccea4a44c2

View File

@ -492,15 +492,6 @@ An API is available to manipulate session data outside of a view::
>>> s['last_login'] >>> s['last_login']
1376587691 1376587691
In order to mitigate session fixation attacks, sessions keys that don't exist
are regenerated::
>>> from django.contrib.sessions.backends.db import SessionStore
>>> s = SessionStore(session_key='no-such-session-here')
>>> s.save()
>>> s.session_key
'ff882814010ccbc3c870523934fee5a2'
If you're using the ``django.contrib.sessions.backends.db`` backend, each If you're using the ``django.contrib.sessions.backends.db`` backend, each
session is just a normal Django model. The ``Session`` model is defined in session is just a normal Django model. The ``Session`` model is defined in
``django/contrib/sessions/models.py``. Because it's a normal model, you can ``django/contrib/sessions/models.py``. Because it's a normal model, you can