in reply to HTTP::Cookies is saving an empty file

I assume what your trying to achieve is just retrieve the cookies from whatever url you are visiting (because it needs cookies for user sessions ???) I did a similar thing a while back, which may/may not help
my $url = shift; my $ua = new LWP::UserAgent; $ua->timeout(20); $ua->agent('Automated agent'); # with cookie support... my $cookies = HTTP::Cookies->new(); $ua->cookie_jar($cookies); my $req = HTTP::Request->new(GET => $url); print STDERR "doing GET request to $url...\n"; my $res = $ua->request($req); my $content = $res->content; my $status = $res->status_line(); $ua->cookie_jar->extract_cookies($res);

Replies are listed 'Best First'.
HTTP::Cookies is saving an empty file
by Anonymous Monk on Jun 23, 2003 at 01:37 UTC
    Before you lose all hope be sure that the page you are 
    requesting actually sends a cookie. I was sure that mine did
     but IT DIDN'T it was actually an image that was on
     the page that was giving my (netscape) browser a cookie. So
     if you are having a hard time goto the command line and:
    
    GET -ed http://www.google.com
    
    to get the headers and if you dont see something like:
    
    Set-Cookie: PREF=ID=44fae06727e94467:TM=1056331233:LM=1056331233:
    S=bt-ZmWiBhxbwpt78; expires=Sun, 17-Jan-2038 19:14:07 GMT;
     path=/; domain=.google.com
    
    then keep trying pages until you do.
    douglasmj1 %%AT%% comcast %%DOT%% net