Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 21533
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: LDS [...] cpan.org
Requestors: webmaster [...] cbkihong.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: webmaster [...] cbkihong.com
Subject: CGI/Util.pm
Date: Sun, 17 Sep 2006 14:46:05 +0800
To: bug-CGI.pm [...] rt.cpan.org
From: Chan Bernard Ki Hong <webmaster [...] cbkihong.com>
CGI.pm (and thus CGI::Cookie) does not seem to handle decimal relative time for "-expires" properly, but the code in CGI/Util.pm makes me think the original intent was to support it. CGI/Util.pm - version 1.5. CGI.pm - version 3.15. Perl: This is perl, v5.8.8 built for i486-linux-gnu-thread-multi uname: Linux cbkihong.homelinux.com 2.6.14.5 #4 PREEMPT Tue May 30 20:35:53 HKT 2006 i686 GNU/Linux #!/usr/bin/perl -w use CGI; my $cgi = new CGI; print $cgi->header( -type => 'text/html', -cookie => [ $cgi->cookie( -name => 'one', -value => 'one', -expires => '+1h', ), $cgi->cookie( -name => 'two', -value => 'two', -expires => '+2.5h', # BUG ), ], ); OUTPUT: Set-Cookie: one=one; path=/; expires=Sun, 17-Sep-2006 07:45:18 GMT Set-Cookie: two=two; path=/; expires=Sun, 17-Sep-2006 06:45:20 GMT The second cookie is created with an earlier expiration time than the first, which is obviously wrong. The attached diff seems to fix it. Thank you. Regards, Bernard Chan.

Message body is not shown because sender requested not to inline it.

Patch accepted. Thanks!