cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: pycurl and cookies

From: Robert D. Young <Robert_at_AbilitySys.com>
Date: Mon, 24 May 2004 08:53:00 -0700

>> How can I get a combination of both the pre-existing cookies and the
>> session cookies to be sent?

>It seems you found a flaw in libcurl. It can't be done without getting
two
>cookie headers, which of course is badness.

>I'll work on a fix.

Actually, I found that the way to get what I wanted was to make sure the
COOKIEFILE/COOKIEJAR had the server-sent cookies in it when I started.
That is, if I have a file with the following lines:

Set-Cookie: key1=value1
Set-Cookie: key2=value2
Set-Cookie: key3=value3

Then set COOKIEFILE and COOKIEJAR, it reads the keys and sends them on
the first GET. Received cookies are then added to the subsequent calls
as desired. The trick was that I had to parse the IE file and convert it
to the above format, then everything works OK.

- Robert
Received on 2004-05-24