Hello,

I am having issues with cookies being set correctly (i
think).

I am simply trying to log into yahoo mail.  Here is my
code:

#!/usr/bin/perl

use strict;
use LWP;
use HTTP::Cookies;
use HTTP::Request;

use vars qw($ua $req $res $username $passwd $url
$cookie_jar);

$username = 'jomama';
$passwd = 'foo';
$cookie_jar = HTTP::Cookies->new(
    file => "$ENV{'HOME'}/.lwp_cookies.dat",
    autosave => 1,
);

$ua = LWP::UserAgent->new;
$ua->agent('Mozilla/5.0');
$ua->cookie_jar($cookie_jar);
$res = $ua->request(POST
'http://login.yahoo.com/config/login',
    [ login     =>  "$username",
      passwd    => "$passwd",
    ]
);

if ($res->is_success) {
    print $res->content;
    }
else {
    print "Damn\n";
}


Everytime I get 'Damn' returned from the above code. 
I have tried this on a similar login form that I can
see the server logs of and it says that the browser
does not support cookies so that is why I am guessing
the problem I am having has to do with cookies.

Thanks for helping a perl beginner.


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Reply via email to