[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Cookie Expiry question



Chris Cummer wrote:
> 
> Ronald J. Kimball wrote:
> 
> >Strangely, your result appears to be in seconds-since-epoch:
> >1241299336 => Sat May  2 17:22:16 2009
> >
> >
> >What version of CGI.pm are you using?
> 
>      What is strange about this? Taking a gander at the rest of the 
> cookies in my cookie file, they all appear in this format and presumably 
> all resolve to some future date.

What is strange about this is that 1241299336 is not a proper format for
HTTP dates.  In other words, as far as I can tell this is a bug in CGI.pm.


>      And seconds-since-epoch...what does this refer to?

Computers store dates as number of seconds since the epoch.  On Unix
systems, the epoch is Midnight, Jan 1, 1970.  On Macs, it's Midnight, Jan
1, 1900 (I think :).  This is a good format for storing dates, since it can
be written as a 32-bit integer, and for comparing dates, because you can
just use numeric comparison, but it is not a good format for expiration
dates in HTTP cookies, because it's just not the right format.


>      I'm using the CGI.pm that's bundled with MacPerl 5.2.0r4. Sorry, I 
> don't know the version number or how to determine it (Shuck doesn't seem 
> to show it).
> 

You might try opening the CGI.pm file in your text editor and seeing if a
version is specified anywhere...  But anyway, MacPerl is already several
years old, as are the modules packaged with it...  So I would not be
surprised if this problem with cookie expirations is a bug in an old
version of CGI.pm.

I'll try your code on my Mac this evening, and see if I get similar
results.

Ronald

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org