"Aman Thind" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi All > > On receiving no reply to my previous post, I myself struggled a bit and came > up with the following code to login to the site : > > -------------------------------------------------------------- > use LWP::UserAgent; > use HTTP::Cookies; > > $ua = LWP::UserAgent->new; > $ua->cookie_jar(HTTP::Cookies->new(file => "lwpcookies.txt",autosave => 1)); > > my $req = HTTP::Request->new(POST => 'http://www.sms.ac/login.asp'); > $req->content_type('application/x-www-form-urlencoded'); > $req->content('loginuserid=myuserid&loginpassword=mypassword'); > my $res = $ua->request($req); > print $res->as_string; > -------------------------------------------------------------- > > However, on running this script, a web page with the following message is > returned : > > Unable to establish login (cookies rejected). > > Could someone please guide me how to overcome this. >
You are running in to some very usual issues with http clients. Really the best we ( or at least myself ) can say is that you are not sending a properly formatted cookie. There is a module called WWW::Mechanize that helps facilitate what you are trying to do. You might want to give it a look. Todd W. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]