Ticket #4914: session_modified_attr.diff
File session_modified_attr.diff, 1.1 KB (added by , 17 years ago) |
---|
-
docs/sessions.txt
188 188 189 189 # Gotcha: Session is NOT modified, because this alters 190 190 # request.session['foo'] instead of request.session. 191 # You need to tell the session framework, that the session 192 # has changed: 191 193 request.session['foo']['bar'] = 'baz' 194 request.session.modified = True 192 195 193 To change this default behavior, set the ``SESSION_SAVE_EVERY_REQUEST`` setting 194 to ``True``. If ``SESSION_SAVE_EVERY_REQUEST`` is ``True``, Django will save 195 the session to the database on every single request. 196 If you are lazy and don't want to set the ``modified`` attribute, you 197 can set the ``SESSION_SAVE_EVERY_REQUEST`` setting to ``True``. If 198 ``SESSION_SAVE_EVERY_REQUEST`` is ``True``, Django will save the 199 session to the database on every single request. 196 200 197 201 Note that the session cookie is only sent when a session has been created or 198 202 modified. If ``SESSION_SAVE_EVERY_REQUEST`` is ``True``, the session cookie