Ticket #6984: session-key-patch.diff

File session-key-patch.diff, 2.3 KB (added by simonb, 7 years ago)
  • django/contrib/sessions/middleware.py

     
    3333                    max_age = settings.SESSION_COOKIE_AGE
    3434                    expires_time = time.time() + settings.SESSION_COOKIE_AGE
    3535                    expires = cookie_date(expires_time)
    36                 # Save the seesion data and refresh the client cookie.
     36                # Save the session data and refresh the client cookie.
    3737                request.session.save()
    3838                response.set_cookie(settings.SESSION_COOKIE_NAME,
    3939                        request.session.session_key, max_age=max_age,
  • django/contrib/sessions/backends/file.py

     
    5757        return session_data
    5858
    5959    def save(self):
     60        # make sure the session dict is loaded into memory before saving it back
     61        self._get_session()
    6062        try:
    6163            f = open(self._key_to_file(self.session_key), "wb")
    6264            try:
  • django/contrib/sessions/backends/cache.py

     
    1515        return session_data or {}
    1616
    1717    def save(self):
     18        # make sure the session dict is loaded into memory before saving it back
     19        self._get_session()
    1820        self._cache.set(self.session_key, self._session, settings.SESSION_COOKIE_AGE)
    1921
    2022    def exists(self, session_key):
  • django/contrib/sessions/backends/db.py

     
    3838        return True
    3939
    4040    def save(self):
     41        # make sure the session dict is loaded into memory before saving it back
     42        self._get_session()
    4143        Session.objects.create(
    4244            session_key = self.session_key,
    4345            session_data = self.encode(self._session),
Back to Top