cURL / Mailing Lists / curl-library / Single Mail


RE: cookies

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


-----Original Message-----
From: Daniel Stenberg
To: T. Bharath
Cc: ''
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
> 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
> may be multiple threads doing the same(trying to retrieve the same or
> different page) Now its quite possible that each time i retrieve an
> from the page(all objects are retrieved simultaneoulsy in different
> threads) the cookie with the same name and obviously from the same
> are sent and dumped into the file causing this problem.

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


> 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
> 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
read and send back cookies. But then it won't store any cookies except

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
using the same name/path/domain when read from a file.

I will

    Daniel Stenberg -- curl groks URLs --
Received on 2002-01-07