in reply to ethixx

Use the HTTP::Cookies module in conjunction with your LWP::UserAgent. I frequently use it like this to give the UserAgent a "normal browserish" looking store for cookies (the cookie jar used in association w/ LWP::UserAgent will receive and send cookies just like a normal browser would):
use HTTP::Cookies; my $agent = new LWP::UserAgent; my $co=new HTTP::Cookies(file=>'./stored.cookies',autosave=>1); $agent->cookie_jar($co);
There are sevearl methods in that module for manipluating cookies/the cookie jar.

Replies are listed 'Best First'.
RE: Re: ethixx
by mdillon (Priest) on Jun 03, 2000 at 23:21 UTC
    i'd just like to point out that when the cookie_jar in LWP::UserAgent is used in this manner, it will automatically grab and store the cookies from all HTTP::Responses returned by the UserAgent. it will also automatically add cookies to all HTTP::Request objects that pass through it.

    so, if you set a UserAgent's cookie jar, there is typically no need to manipulate the cookie jar manually (i.e. with extract_cookies and add_cookie_header).