jbaez has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to automate my login to JetBlue Airways. I got the header information using Firefox and Tamper Data. Below is the code that I have tried using. I have a feeling it has something to do with the way i'm setting the cookie. Any help would be appreciated.
#!/usr/bin/perl -w use strict; use LWP::UserAgent; use HTTP::Cookies; #use LWP::Debug qw(+); my $url = 'https://www.jetblue.com/trueblue/ff_login.aspx'; my $client = LWP::UserAgent->new; my $signinform = $client->get($url); $signinform = $signinform->content; $signinform =~ m/__VIEWSTATE" value="(.*?)"/; my $view_state = $1; my $lwp_obj = LWP::UserAgent->new(); $lwp_obj->cookie_jar({}); my $resp = $lwp_obj->post($url, [ 'UserName' => 'testjetblue%40live.com', 'Password' => '565656', '__VIEWSTATE' => $view_state, ], 'Host' => 'www.jetblue.com', 'User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; +en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13', 'Accept' => 'text/xml,application/xml,application/xhtml+xm +l,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'Accept-Language' => 'en-us', 'Accept-Encoding' => 'gzip,deflate', 'Accept-Charset' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'Keep-Alive' => '300', 'Connection' => 'keep-alive', 'Referer' => 'https://www.jetblue.com/trueblue/ff_login.as +px', ); print $resp->content;

Replies are listed 'Best First'.
Re: LWP Authentication
by oko1 (Deacon) on Mar 30, 2008 at 03:07 UTC

    Testing the above returns a page that says, in part:

    JetBlue's TrueBlue site uses Javascript, which appears to be turned off. Click here to learn how to activate it.
    

    It appears that cookies are not the problem here; JS is - and that's been discussed here previously.

    
    -- 
    Human history becomes more and more a race between education and catastrophe. -- HG Wells