cURL / Mailing Lists / curl-library / Single Mail

curl-library

Disabling automatic handling of 'Set-Cookie:'

From: Ashu Sharma <ashutoshsharma_at_gmail.com>
Date: Wed, 5 Apr 2006 01:12:14 +0530

Hi,

I have a query about handling of cookies in libcurl. Is it possible to
disable automatic handling of cookies by libcurl. By default, on receiving a
HTTP header 'Set-Cookie:', libcurl adds the cookie for subsequent requests.

I'm providing my own cookie for the HTTP headers to be sent to a server,
through:

curl_easy_setopt(curlhandle, CURLOPT_HTTPHEADER, sList)

where one of the headers in sList is the cookie I want to set (I've tried
using CURLOPT_COOKIE too). This results in libcurl sending out two 'Cookie:'
headers to the server (with two different values for the same key, causing
the server to use the first one it gets, which is not the one intended).

Is it possible to avoid this, so that libcurl does not automatically send
cookies that it saved earlier to the server?

Thanks,
Ashutosh
Received on 2006-04-04