cURL / Mailing Lists / curl-library / Single Mail


Re: Behaviour of Multiple Cookiefiles

From: Daniel Stenberg <>
Date: Wed, 23 Jan 2008 20:34:36 +0100 (CET)

On Wed, 23 Jan 2008, aniket ray wrote:

> For a specific cookie, one of the cookie files contains an expired cookie
> while the other file contains a session cookie (with same domain,path, name
> but different value). No matter whichever cookie file I specify first, I see
> that the expired cookie is getting picked up.

If you enable verbose, it'll mention when it adds and/or replaces cookies.

> How does libcurl pickup cookies from multiple cookie files? Is there a way I
> can force a preference to a particular file's cookies?

The intention is that it loads the cookies in a cronological order so if you
load th esame cookie three times, the last occurance is the one that it'll
contain afterwards.

It would be simpler to understand and follow your issue(s) if you could
present detailed recipes to repeat your perceived problem.

> Also, how is the cookiejar maintained?

It's not really "maintained", it's written when you close the easy handle.

> When I manually write cookies to the jar file. Why is it that it sometimes
> get picked up, while sometimes not?

It loads cookies from the specified file at the start of curl_easy_perform().
Again, you need to be more specific about "sometimes" and what you did.

  Commercial curl and libcurl Technical Support:
Received on 2008-01-23