Django

Code

Ticket #4914: 4914.2.patch

File 4914.2.patch, 0.9 kB (added by SmileyChris, 1 year ago)

small reword

  • docs/sessions.txt

    old new  
    190190    # request.session['foo'] instead of request.session. 
    191191    request.session['foo']['bar'] = 'baz' 
    192192 
    193 To change this default behavior, set the ``SESSION_SAVE_EVERY_REQUEST`` setting 
     193To save the session explicitly, you can set ``request.session.modified`` to 
     194``True``:: 
     195 
     196    # Session is not modified directly, so inform the session that it has changed. 
     197    request.session['foo']['bar'] = 'baz' 
     198    request.session.modified = True 
     199 
     200To change the default behavior of only saving to the session database when the 
     201session has been modified, set the ``SESSION_SAVE_EVERY_REQUEST`` setting 
    194202to ``True``. If ``SESSION_SAVE_EVERY_REQUEST`` is ``True``, Django will save 
    195203the session to the database on every single request. 
    196204