cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: cookies

From: T. Bharath <TBharath_at_responsenetworks.com>
Date: Mon, 7 Jan 2002 10:16:43 -0500

 

-----Original Message-----
From: Daniel Stenberg
To: T. Bharath
Cc: 'curl-library_at_lists.sourceforge.net'
Sent: 1/7/02 9:34 AM
Subject: Re: cookies

On Mon, 7 Jan 2002, T. Bharath wrote:

> Yes your solution is abetter one As you had rightly pointed out, the
same
> cookie seems to exist multiple times in the list

That indicates a problem somewhere, I'd say.

> I am trying to emulate a browser where by i download the first page
and the
> parse it and retrieve all the other objects used to render that page
There
> may be multiple threads doing the same(trying to retrieve the same or
a
> different page) Now its quite possible that each time i retrieve an
object
> from the page(all objects are retrieved simultaneoulsy in different
> threads) the cookie with the same name and obviously from the same
domain
> are sent and dumped into the file causing this problem.

Ah, you mean that each thread writes the cookies to a single file that
is
later read by curl? The intention is still that only each cookie should
only
exist once in the list. A cookie being a unique combination of name,
domain
and path.

yes,

> The only way i can avoid this is to stop dumping the cookies in the
file If
> i dont specify the COOKIE_JAR option then i believe curl doesnt handle
any
> cookies (that is it doesnt send back the cookies) am i right?

You can specify the CURLOPT_COOKIEFILE with a non-existing file to make
curl
read and send back cookies. But then it won't store any cookies except
in
memory.

But at the end of the session ,will it not create the file and dump it
I have lots of threads doing the same thing so i have to specify a different
name dynamically leading to the creation of lots of file
am i right

> Is there a way to avoid this prob

I'd appreciate if you could check why/if curl accepts more than one
cookie
using the same name/path/domain when read from a file.

I will

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Regards
Bharath
Received on 2002-01-07