GNU bug report logs -
#6957
url-cookie-expired-p
Previous Next
Reported by: shawn boles <shawn.boles <at> gmail.com>
Date: Tue, 31 Aug 2010 20:08:02 UTC
Severity: normal
Fixed in version 23.3
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 6957 <at> debbugs.gnu.org (full text, mbox):
On Tue, Aug 31, 2010 at 4:39 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
> (float-time) already gives the seconds since epoch. No need to convert
> to string and back, or doing any time zone adjustments.
Hi Andreas,
Thank you for your reply.
I understand that (float-time) gives the seconds since Epoch. Maybe I
am missing something here...
This does not change the issue that (url-cookie-expired-p) is taking
the time string from (current-time-string), adjusted to the user's
timezone and comparing it against a cookie expiration time string,
adjusted to GMT. (url-cookie-expired-p) is not taking into account
that the times are (most likely) in different timezones.
Once I had settled the time normalization issue, I noticed that my
hour long session cookies were still not expiring. After I added
debugging I discovered that (url-cookie-expired-p) was comparing the
current time: "16:30:00" (PST) against "23:30:00" (GMT). My solution
(arguably not the best!) is to get the current time in seconds since
the Epoch (float-time), adjust it to a time that is GMT with the value
of (car (current-timezone)) and then make the comparison. This may not
be the best solution, but! (url-cookie-expired-p) is now comparing
like times.
Please let me know if I am way off base here.
It occurs to me that the date comparison is also wrong, for the same
reason: It takes a date string from (current-time-string), adjusted to
the user's timezone and compares it against a cookie date string in
GMT. I would like to fix this as well.
Thank you,
shawn
This bug report was last modified 14 years and 342 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.