>so in my use case, the website won't supply these cookies. I need to
>explicitly create them.
OK, so my suggestion is use the file-saved variety of "new":
my $cookie_jar = HTTP::Cookies->new(
file => './cookies.txt',
autosave => 0,
ignore_discard => 1,
hide_cookie2 => 1
);
And cook cookies to your heart content!
An actual sample of a cookie jar file is:
#LWP-Cookies-1.0<Line-break>
Set-Cookie3: ASP.NET_SessionId=t2unhj55gvyaei45ddfqnk55; path="/";
domain=www.magna.isa.gov.il; path_spec; discard; HttpOnly;
version=0<line-break>
A few notes:
1) Please note the line breaks. The second line split due to the plain-text
e-mail's 80 chars/line limit.
2) This is an actual saved cookie! It was saved despite the fact that it
contained a <discard;> clause. This is the result of the
<ignore_discard => 1,> element in the constructor.
3) More details are on the HTTP::Cookies man page. Read carefully. Important
issues are covered rather tersely, as an afterthought. (Ze ma yesh :-( )
Regards,
Meir
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl