cURL / Mailing Lists / curl-library / Single Mail

curl-library

Behaviour of Multiple Cookiefiles

From: aniket ray <aniket.ray_at_gmail.com>
Date: Wed, 23 Jan 2008 18:18:36 +0530

Hi,
I have a few questions about the behaviour of libcurl while using multiple
cookie files.

I've used curl_easy_setopt with the CURLOPT_COOKIEFILE parameter to specify
two different cookie files.

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.

I'd like to mention that the file containing the session cookie is also the
cookie jar file. So what's happening is that in the jar file, the session
cookie is getting replaced with an expired cookie.

How does libcurl pickup cookies from multiple cookie files? Is there a way I
can force a preference to a particular file's cookies?
Also, how is the cookiejar maintained? When I manually write cookies to the
jar file. Why is it that it sometimes get picked up, while sometimes not?

Thanks in advance,
Aniket
Received on 2008-01-23