in reply to Re: What is a Cookie Jar?
in thread What is a Cookie Jar?

Is there a reason you say "$request = new HTTP::Request('GET', $init_url);", but then on the next line the variable is $reponse instead of $request?

Replies are listed 'Best First'.
Re: Re: Re: What is a Cookie Jar?
by bobn (Chaplain) on Jul 04, 2003 at 18:40 UTC

    Yes. I''m a space cadet.

    I was cutting and pating and forgot:

    $response = $ua->request($request);
    Also, after reading the lwpcookbook referenced in another post here, it appears I'm still doing more work than needed. Apparently, just attaching the cookie_jar to the UserAgent object does the job, thouhg I haven't actually tested this.

    update: I probably had to do the extract and add because I was using simple_request, due to doing other things (referer, other headers in redirected requests.) I expect that folks using the the normal $ua->request methind can just do a $ua->cookie_jar(options..) and forget about it.

    --Bob Niederman, http://bob-n.com