Re: keeping http session between requests



zawszedamian_p@xxxxxxxxx writes:

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?

You might want to have a look at WWW::Mechanize.

sherm--

--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
.



Relevant Pages

  • Re: Thread not working
    ... So only one request for one session can come in. ... Second request will be ... will not end the lifecycle you ... "Jason Chu" < ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Holding session in HTTPWebRequest
    ... The Session ID will be in a non-persistent cookie passed back to the ... The next page always gives response ... So I assume somehow session or some other state persistence drops in ... between first and second request. ...
    (microsoft.public.dotnet.general)
  • keeping http session between requests
    ... I was trying to download page and keep http session between requests ...
    (comp.lang.perl.misc)