Skip to content

HTTP::Cookies don't add ".domain" cookies to "domain" requests [rt.cpan.org #49898] #29

@oalders

Description

@oalders

Migrated from rt.cpan.org#49898 (status was 'open')

Requestors:

Attachments:

From hsw@cpan.org on 2009-09-22 05:18:09:

Cookie:
Set-Cookie: dotdomain=1; path=/; domain=.moikrug.ru

not passed to request:
GET http://moikrug.ru/

Additional tests for t/base/cookies.t included.

From dma_k@mail.ru on 2010-08-08 20:23:44:

I confirm the problem. RFC 2965 does not have concrete example of
matching "domain.com" against ".domain.com".

The current workaround is to specify "host" header separately:

my $ua = LWP::UserAgent->new();
my $cookie = HTTP::Cookies->new(
    file => '/tmp/cookies.txt',
    autosave => 1
);
my $r = HTTP::Request::Common::GET('http://host.com', host =>
'www.host.com');
$ua->prepare_request($r);
$cookie->add_cookie_header($r);
print Data::Dumper->Dump([\$r], ["r"]);

Sergey, if you have a patch for Cookies.pm, you are welcome to attach it.

From ether@cpan.org on 2017-01-25 21:39:08:

migrated queues: libwww-perl -> HTTP-Cookies

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions