keeping http session between requests

Z

zawszedamian_p

I was trying to download page and keep http session between requests
like this:

my $request = HTTP::Request->new(GET => $URL_login_page);
my $response = $browser->request($request);
# save cookie
$cookie = $response->header("Set-cookie"); # here cookie is not null

$request = HTTP::Request->new(GET => $URL_get_data);
# set saved cookie
$request->header("Set-cookie", $cookie);

but it does not work - session is not not forwarded to second request,
cookie's gone

how can I keep session between requests?

thanks for your help
 
B

Ben Morrow

Quoth (e-mail address removed):
I was trying to download page and keep http session between requests
like this:
but it does not work - session is not not forwarded to second request,
cookie's gone

how can I keep session between requests?

Use the cookie_jar option the LWP::UserAgent->new.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top