Ticket #6984: session-key-patch.diff
File session-key-patch.diff, 2.3 KB (added by , 17 years ago) |
---|
-
django/contrib/sessions/middleware.py
33 33 max_age = settings.SESSION_COOKIE_AGE 34 34 expires_time = time.time() + settings.SESSION_COOKIE_AGE 35 35 expires = cookie_date(expires_time) 36 # Save the se esion data and refresh the client cookie.36 # Save the session data and refresh the client cookie. 37 37 request.session.save() 38 38 response.set_cookie(settings.SESSION_COOKIE_NAME, 39 39 request.session.session_key, max_age=max_age, -
django/contrib/sessions/backends/file.py
57 57 return session_data 58 58 59 59 def save(self): 60 # make sure the session dict is loaded into memory before saving it back 61 self._get_session() 60 62 try: 61 63 f = open(self._key_to_file(self.session_key), "wb") 62 64 try: -
django/contrib/sessions/backends/cache.py
15 15 return session_data or {} 16 16 17 17 def save(self): 18 # make sure the session dict is loaded into memory before saving it back 19 self._get_session() 18 20 self._cache.set(self.session_key, self._session, settings.SESSION_COOKIE_AGE) 19 21 20 22 def exists(self, session_key): -
django/contrib/sessions/backends/db.py
38 38 return True 39 39 40 40 def save(self): 41 # make sure the session dict is loaded into memory before saving it back 42 self._get_session() 41 43 Session.objects.create( 42 44 session_key = self.session_key, 43 45 session_data = self.encode(self._session),