develooper Front page | perl.libwww | Postings from June 2003

Passing the same cookie and headers to a new site

Thread Next
From:
Alan Olegario
Date:
June 19, 2003 10:05
Subject:
Passing the same cookie and headers to a new site
Message ID:
204AB30D250D5945B495E9BC153366FB64E288@NYCLUSTER01.fxall.com
I'm trying to log into a site and then pass the same cookies and headers that are used for the first site into another site.  Should I just be able to do a get to the second site and still maintain the same cookies and headers?

Here's the meat of my code:

foreach $target(@targets) {
        if ($verbose!=0) {print "INFO:  Logging into $target\n"};
        $browser = LWP::UserAgent->new;
        $response = $browser->post(
                'https://www.firstsite.com/',
                [
                        "USER" => $username,
                        "PASSWORD" => $password,
                ]
        );

        if ($verbose!=0) {print "RESPONSE\n";}
        if ($verbose!=0) {print $response->as_string;print "\n";}

        if ($verbose!=0) {print "INFO:  Logging into second site\n";}
        $response = $browser->get('https://www.secondsite.com');
        if ($verbose!=0) {print "RESPONSE\n";}
        if ($verbose!=0) {print $response->as_string;print "\n";}
}

Thanks in advance.

--------------------------
Alan Olegario
http://www.fxall.com
alan.olegario@fxall.com
(P) 646-268-9988
(F) 646-268-9996
(C) 732-501-5212


DISCLAIMER:
This message is intended for the named addressee(s) only and contains information that may be confidential, non-public or legally privileged.  If you are not the intended recipient, you must not copy this message or attachment or disclose the contents to any other person.  If you received this email in error, please contact the sender and permanently delete the email and any attachments. Unless expressly stated, opinions in this email are those of the individual sender and not of FX Alliance, LLC or its affiliates.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About