[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#6957: url-cookie-expired-p Redux
From: |
shawn boles |
Subject: |
bug#6957: url-cookie-expired-p Redux |
Date: |
Tue, 31 Aug 2010 17:43:53 -0700 |
On Tue, Aug 31, 2010 at 4:39 PM, Andreas Schwab <schwab@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