Thread Problem bei cURL Aufrufen... (19 answers)
Opened by ~Br4inP4in~ at 2008-04-23 18:03

Gast Gast
 2008-05-01 02:44
#109062 #109062
$ua->cookie_jar([$cookie_jar_obj])

Get/set the cookie jar object to use. The only requirement is that the cookie jar object must implement the extract_cookies($request) and add_cookie_header($response) methods. These methods will then be invoked by the user agent as requests are sent and responses are received. Normally this will be a HTTP::Cookies object or some subclass.

The default is to have no cookie_jar, i.e. never automatically add "Cookie" headers to the requests.

Shortcut: If a reference to a plain hash is passed in as the $cookie_jar_object, then it is replaced with an instance of HTTP::Cookies that is initalized based on the hash. This form also automatically loads the HTTP::Cookies module. It means that:

$ua->cookie_jar({ file => "$ENV{HOME}/.cookies.txt" });

is really just a shortcut for:

require HTTP::Cookies;
$ua->cookie_jar(HTTP::Cookies->new(file => "$ENV{HOME}/.cookies.txt"));

View full thread Problem bei cURL Aufrufen...