Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #4914 -- Documented the Session.modified attribute for forcing …

…session saves. Thanks, Thomas Güttler and SmileyChris.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5869 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a564adb8e1eaa90c52b683ae64d0570291257c2b 1 parent 6d31e43
Malcolm Tredinnick malcolmt authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 docs/sessions.txt
6 docs/sessions.txt
View
@@ -190,6 +190,12 @@ deleted::
# request.session['foo'] instead of request.session.
request.session['foo']['bar'] = 'baz'
+In the last case of the above example, we can tell the session object
+explicitly that it has been modified by setting the ``modified`` attribute on
+the session object::
+
+ request.session.modified = True
+
To change this default behavior, set the ``SESSION_SAVE_EVERY_REQUEST`` setting
to ``True``. If ``SESSION_SAVE_EVERY_REQUEST`` is ``True``, Django will save
the session to the database on every single request.
Please sign in to comment.
Something went wrong with that request. Please try again.