Libwww-perl cookie jar
From Just Solve the File Format Problem
(Difference between revisions)
Dan Tobias (Talk | contribs) m |
Dan Tobias (Talk | contribs) |
||
Line 1: | Line 1: | ||
+ | {{DISPLAYTITLE:libwww-perl cookie_jar}} | ||
{{FormatInfo | {{FormatInfo | ||
|formattype=electronic | |formattype=electronic |
Latest revision as of 01:20, 20 July 2017
The cookie_jar file is used by libwww-perl, a library for the Perl programming language to access Web pages, to store cookies when they are given by sites which are accessed, so they can be sent back as needed in further web accesses.
By default, libwww-perl ignores cookies, but you can enable them with the proper commands:
use LWP::UserAgent; use HTTP::Cookies; $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file => "cookie_jar", autosave => 1));
You can actually name the file whatever you want (lwpcookies.txt is suggested in the libwww-perl cookbook linked below), but "cookie_jar" seems to be a traditional name (real Unix geeks don't need no steenkin' file extensions).
The format is text-based, like this:
#LWP-Cookies-1.0 Set-Cookie3: stuff=1234567890; path="/"; domain=.test.example; path_spec; expires="2032-11-03 15:52:59Z"; version=0
The opening comment line "#LWP-Cookies-1.0" seems to be a signature sequence that can be used to check that a file is in fact a LWP cookie jar.