I want to be able to check a secure page that I login to to access some data. First off, the page is here: https://www.mbnanetaccess.com/NASApp/NetAccess/RegisteredAccountsDisplay?&ehn=670 The account login page is on the front page: http://www.mbna.com/ The login is done via POST. So this is what I've tried:
$url = "https://www.mbnanetaccess.com/NASApp/NetAccess/Login"; $browser = LWP::UserAgent->new(); $browser->timeout(10); @fields = [username => 'myusername', password => 'mypassword' ]; my $response = $browser->post($url,@fields); if ($response->is_error()) { printf "Error!"; printf "%s\n", $response->status_line; } $contents = $response->content(); print $contents;
But this returns nothing in the contents (but it does not error, which leads me to believe that it logged in correctly). When I login with my real browser, the POST redirects me to a new page at https://www.mbnanetaccess.com/NASApp/NetAccess/RegisteredAccountsDisplay?&ehn=670 which is where I want to extract some information. However, I'm unsure about how this redirect is passed down to the browser. Also, there must some sort of secure session state that is carried along, but again, I'm not sure where it is. Is there some tool that will allow me to see the primitive GETS, POSTS, session states etc. when I login with my real browser? So that I can mimic this with perl? Anyone have other suggestions?

In reply to Secure Sessions and HTTPS by jamesjyu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.