How can I print the cookie_jar values in Perl's WWW::Mechanize?
- by Phill Pafford
How can I print the values of the cookie/cookie_jar being set?
Trying:
##my $cookie_jar=HTTP::Cookies->new(file => "cookie.jar",autosave=>1,ignore_discard=>1);
my $cookie_jar=HTTP::Cookies->new(); ## Would like it to be in memory
my $agent = WWW::Mechanize->new(cookie_jar => $cookie_jar);
##my $agent = WWW::Mechanize->new();
##my $agent = WWW::Mechanize->new(autocheck => 1);
##$agent->cookie_jar( {} );
# we need cookies
##$agent->cookie_jar(HTTP::Cookies->new);
print "Set Cookie Jar?\n";
print $agent->cookie_jar->as_string();
print "\n";
$agent->get($url); // url is a https site
Not too much luck with any of these, what am I doing wrong?