NAME

HTTP::Cookies - HTTP cookie jars

VERSION

version 6.03

SYNOPSIS

use HTTP::Cookies;
$cookie_jar = HTTP::Cookies->new(
  file => "$ENV{'HOME'}/lwp_cookies.dat",
  autosave => 1,
);

use LWP;
my $browser = LWP::UserAgent->new;
$browser->cookie_jar($cookie_jar);

Or for an empty and temporary cookie jar:

use LWP;
my $browser = LWP::UserAgent->new;
$browser->cookie_jar( {} );

DESCRIPTION

This class is for objects that represent a "cookie jar" -- that is, a database of all the HTTP cookies that a given LWP::UserAgent object knows about.

Cookies are a general mechanism which server side connections can use to both store and retrieve information on the client side of the connection. For more information about cookies refer to URL:http://curl.haxx.se/rfc/cookie\_spec.html and URL:http://www.cookiecentral.com/. This module also implements the new style cookies described in RFC 2965. The two variants of cookies are supposed to be able to coexist happily.

Instances of the class HTTP::Cookies are able to store a collection of Set-Cookie2: and Set-Cookie: headers and are able to use this information to initialize Cookie-headers in HTTP::Request objects. The state of a HTTP::Cookies object can be saved in and restored from files.

LIMITATIONS

This module does not support Public Suffix encouraged by a more recent standard, RFC 6265.

This module's shortcomings mean that a malicious Web site can set cookies to track your user agent across all sites under a top level domain. See t/publicsuffix.t in this module's distribution for details.

HTTP::CookieJar::LWP supports Public Suffix, but only provides a limited subset of this module's functionality and does not support standards older than RFC 6265.

METHODS

The following methods are provided:

SEE ALSO

HTTP::Cookies::Netscape, HTTP::Cookies::Microsoft

AUTHOR

Gisle Aas gisle@activestate.com

COPYRIGHT AND LICENSE

This software is copyright (c) 2002-2017 by Gisle Aas.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.