Ticket #4119: middleware.py.3.diff

File middleware.py.3.diff, 938 bytes (added by Ciantic, 8 years ago)

Same fix, but apparenlty assumption of GMT convert was wrong. This uses utcnow again.

  • django/contrib/sessions/middleware.py

     
    9494                    expires = None
    9595                else:
    9696                    max_age = settings.SESSION_COOKIE_AGE
    97                     expires = datetime.datetime.strftime(datetime.datetime.utcnow() + datetime.timedelta(seconds=settings.SESSION_COOKIE_AGE), "%a, %d-%b-%Y %H:%M:%S GMT")
     97                    expires = (datetime.datetime.utcnow() + datetime.timedelta(seconds=settings.SESSION_COOKIE_AGE)).ctime()
    9898                new_session = Session.objects.save(session_key, request.session._session,
    9999                    datetime.datetime.now() + datetime.timedelta(seconds=settings.SESSION_COOKIE_AGE))
    100100                response.set_cookie(settings.SESSION_COOKIE_NAME, session_key,
Back to Top