in reply to WWW::Mechanize Cookie debugging
Don't forget to delete the cookie_jar.dat. The cookie expires in 10 years:).#!/usr/bin/perl use strict; use warnings; use LWP; use WWW::Scripter; use HTTP::Cookies; my $cookie_file = '/root/Desktop/cookie_jar.dat'; my $cookie_jar = HTTP::Cookies->new( file => $cookie_file, autosave => 1 ); my $ua = LWP::UserAgent->new; $ua->default_header('Accept-Encoding' => scalar HTTP::Message::decodable()); $ua->add_handler("request_send", sub { shift->dump; return }); $ua->add_handler("response_done", sub { shift->dump; return }); $ua->cookie_jar($cookie_jar); $ua->get('http://www.kcra.com');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: WWW::Mechanize Cookie debugging
by GaijinPunch (Pilgrim) on Jul 01, 2011 at 11:51 UTC |