Opened 9 years ago

Closed 8 years ago

#2499 closed enhancement (invalid)

Sessions problem with GMT settings...

Reported by: msw@… Owned by: adrian
Component: Contrib apps Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

please see line 87 of contrib\sessions\middleware:
87 expires = datetime.datetime.strftime(datetime.datetime.utcnow() + datetime.timedelta(seconds=settings.SESSION_COOKIE_AGE), "%a, %d-%b-%Y %H:%M:%S GMT")

There is error in this line, if user works in not GMT time (for example, GMT+2, etc)...
So, please correct this line :)

Change History (5)

comment:1 Changed 9 years ago by msw@…

ADD: not correctly using datetime.datetime.utcnow() function call, i think... am i right?

comment:2 Changed 9 years ago by msw@…

  • Type changed from defect to enhancement

Sorry, but maybe i am mistaken... if i set TIME_ZONE to "UTC" then all working correctly... :) But anyway - something wrong with Time settings in Django code... so i correct type of this Ticket to enhancement

comment:3 Changed 8 years ago by Simon G. <dev@…>

Can anyone provide more info on this? a test case?

comment:4 Changed 8 years ago by Michael Radziej <mir@…>

msw, is this perhaps about Microsoft Windows (then it's been solved in the meantime!)

comment:5 Changed 8 years ago by SmileyChris

  • Resolution set to invalid
  • Status changed from new to closed

This looks invalid to me. If we're using datetime.utcnow() then it's fine to use "GMT" in our cookie - in fact it's probably easier.

Note: See TracTickets for help on using tickets.
Back to Top