http://qs1969.pair.com?node_id=368525


in reply to Dealing with session cookies

Hi!

Could you post some more information on the error you get, and they way you followed to deal with cookies? Anyhow, you can easily do the job using LWP. Here's an example, which I took from lwpcook man page (it becomes available on you system when you install LWP):

use LWP::UserAgent; use HTTP::Cookies; + $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file => "lwpcookies.txt", autosave => 1)); + # and then send requests just as you used to do $res = $ua->request(HTTP::Request->new(GET => "http://www.yahoo.no")); print $res->status_line, "\n";

Basically, this code creates a cookie jar for you and handles all cookie things automagically. It should be what you are looking for. ;-)

Michele.