Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

magic-removal: Merged to [1978]

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1979 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c86d34a935519aa59b3c04b0845f6c8a6ef80fbd 1 parent 34c587e
@adrianholovaty adrianholovaty authored
Showing with 10 additions and 8 deletions.
  1. +1 −0  AUTHORS
  2. +9 −8 django/contrib/sessions/middleware.py
View
1  AUTHORS
@@ -35,6 +35,7 @@ answer newbie questions, and generally made Django that much better:
Andreas
David Ascher <http://ascher.ca/>
Arthur <avandorp@gmail.com>
+ Jiri Barton
James Bennett
Paul Bissex <http://e-scribe.com/>
Simon Blanchard
View
17 django/contrib/sessions/middleware.py
@@ -69,12 +69,13 @@ def process_response(self, request, response):
try:
modified = request.session.modified
except AttributeError:
- modified = False
- if modified or SESSION_SAVE_EVERY_REQUEST:
- session_key = request.session.session_key or Session.objects.get_new_session_key()
- new_session = Session.objects.save(session_key, request.session._session,
- datetime.datetime.now() + datetime.timedelta(seconds=SESSION_COOKIE_AGE))
- expires = datetime.datetime.strftime(datetime.datetime.utcnow() + datetime.timedelta(seconds=SESSION_COOKIE_AGE), "%a, %d-%b-%Y %H:%M:%S GMT")
- response.set_cookie(SESSION_COOKIE_NAME, session_key,
- max_age=SESSION_COOKIE_AGE, expires=expires, domain=SESSION_COOKIE_DOMAIN)
+ pass
+ else:
+ if modified or SESSION_SAVE_EVERY_REQUEST:
+ session_key = request.session.session_key or Session.objects.get_new_session_key()
+ new_session = Session.objects.save(session_key, request.session._session,
+ datetime.datetime.now() + datetime.timedelta(seconds=SESSION_COOKIE_AGE))
+ expires = datetime.datetime.strftime(datetime.datetime.utcnow() + datetime.timedelta(seconds=SESSION_COOKIE_AGE), "%a, %d-%b-%Y %H:%M:%S GMT")
+ response.set_cookie(SESSION_COOKIE_NAME, session_key,
+ max_age=SESSION_COOKIE_AGE, expires=expires, domain=SESSION_COOKIE_DOMAIN)
return response
Please sign in to comment.
Something went wrong with that request. Please try again.