Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 49467
Status: resolved
Priority: 0/
Queue: libwww-perl

Owner: Nobody in particular
Requestors: CLAESJAC [...]

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

Subject: HTTP::Cookies doesn't handle expires = Thu Jan 1 00:00:00 1970; correctly
Download (untitled) / with headers
text/plain 220b
HTTP::Cookies seems to have an issue when expires is set to 1970-01-01 00:00:00 (ie epoch 0) or the few hours after it. The attached script prints a cookie header for a cookie that have explicitly been set to expire.
#!/usr/bin/perl use strict; use HTTP::Cookies; use HTTP::Request; use HTTP::Response; my $jar = HTTP::Cookies->new(); my $r = HTTP::Response->new(200, "OK", [ "Set-Cookie" => "test=1; path=/; expires=Sun Feb 24 16:34:08 2036;" ], ""); $r->request(HTTP::Request->new(GET => "http://localhost/")); $jar->extract_cookies($r); my $r2 = HTTP::Response->new(200, "OK", [ "Set-Cookie" => "test=1; path=/; expires=Fri Jan 1 00:00:00 1970;" ], ""); $r2->request(HTTP::Request->new(GET => "http://localhost/")); $jar->extract_cookies($r2); my $req = HTTP::Request->new(GET => "http://localhost/"); $jar->add_cookie_header($req); print $req->as_string;
Fixed by < perl/commit/e801d82d7be934f823063eed551a30a1fa21d30a>

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to