all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: shawn boles <shawn.boles@gmail.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: 6957@debbugs.gnu.org
Subject: bug#6957: url-cookie-expired-p Redux
Date: Tue, 31 Aug 2010 17:43:53 -0700	[thread overview]
Message-ID: <AANLkTimWMV6Rqb8DSoPXHR2qdVmSWoJEZpWaR+ABXwGi@mail.gmail.com> (raw)
In-Reply-To: <m239tuwdw4.fsf@igel.home>

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





  reply	other threads:[~2010-09-01  0:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-31 20:07 bug#6957: url-cookie-expired-p shawn boles
2010-08-31 22:51 ` bug#6957: url-cookie-expired-p Redux shawn boles
2010-08-31 23:39   ` Andreas Schwab
2010-09-01  0:43     ` shawn boles [this message]
2010-09-02 17:13 ` bug#6957: url-cookie-expired-p Redux (at last) shawn boles
2010-09-09  5:39   ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimWMV6Rqb8DSoPXHR2qdVmSWoJEZpWaR+ABXwGi@mail.gmail.com \
    --to=shawn.boles@gmail.com \
    --cc=6957@debbugs.gnu.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.