Ticket #8269: only-save-sessions-when-modified.patch

File only-save-sessions-when-modified.patch, 608 bytes (added by Collin Grady, 16 years ago)
  • django/contrib/sessions/backends/base.py

     
    3333        return self._session[key]
    3434
    3535    def __setitem__(self, key, value):
    36         self._session[key] = value
    37         self.modified = True
     36        if not key in self._session or self._session[key] != value:
     37            self._session[key] = value
     38            self.modified = True
    3839
    3940    def __delitem__(self, key):
    4041        del self._session[key]
Back to Top