From a564adb8e1eaa90c52b683ae64d0570291257c2b Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sun, 12 Aug 2007 10:24:21 +0000 Subject: [PATCH] =?UTF-8?q?Fixed=20#4914=20--=20Documented=20the=20Session?= =?UTF-8?q?.modified=20attribute=20for=20forcing=20session=20saves.=20Than?= =?UTF-8?q?ks,=20Thomas=20G=C3=BCttler=20and=20SmileyChris.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://code.djangoproject.com/svn/django/trunk@5869 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/sessions.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/sessions.txt b/docs/sessions.txt index c7124ba703..96a88c617a 100644 --- a/docs/sessions.txt +++ b/docs/sessions.txt @@ -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.