On Fri Mar 21 21:39:54 2008, MARKSTOS wrote:
Show quoted text> To the original reporter:
>
> After reviewing this in detail, I believe this is not a bug in
> CGI::Session at all. While the RFC comments on "expire" vs "Max-Age" are
> interesting, I don't believe they are related here.
>
> To produce the result you saw like "expires=+60s", CGI::Session would
> have had to correctly pass the value "60" to the query object, which is
> then responsible for building the cookie text. The following
> demonstrates that both the current CGI.pm and CGI::Simple return the
> right result. Therefore, I conclude that you were using an older CGI.pm
> or CGI::Simple or some other buggy query object. Which query object were
> you using, and what version was it?
>
> ###
>
> use CGI::Cookie;
> my $cookie = CGI::Cookie->new(
> '-name' => 'n',
> '-value' => 'v',
> '-expires' => '+2s',
> );
> print "$cookie\n";
>
> use CGI::Simple::Cookie;
> my $cookie2 = CGI::Simple::Cookie->new(
> '-name' => 'n',
> '-value' => 'v',
> '-expires' => '+2s',
> );
> print "$cookie2\n";
>
> # Result:
> # n=v; path=/; expires=Sat, 22-Mar-2008 01:26:57 GMT
> # n=v; path=/; expires=Sat, 22-Mar-2008 01:26:57 GMT
okay, got to the bottom of this, i'm using CGI::Util version 1.5 in the
code to calculate time:
} elsif ($time=~/^([+-]?(?:\d+|\d*\.\d*))([mhdMy])/) {
as you can see it does not handle seconds! (s)
Looking at the latest CGI::Util 1.5_01
} elsif ($time=~/^([+-]?(?:\d+|\d*\.\d*))([smhdMy])/) {
it's now supporting seconds!
Thanks for your help, greatly appreciated!