cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Disabling automatic handling of 'Set-Cookie:'

From: Ashu Sharma <ashutoshsharma_at_gmail.com>
Date: Wed, 5 Apr 2006 16:18:10 +0530

On 4/5/06, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Wed, 5 Apr 2006, Ashu Sharma wrote:
>
> > 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.
>
> That is incorrect. By default libcurl ignores incoming cookies, you need
> to
> enable it for it to be done. CURLOPT_COOKIEJAR and CURLOPT_COOKIEFILE
> enable
> that.
>
> > 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
>
> Yes, telling libcurl to deal with cookies and then provide your set is
> kind of
> confusing. What libcurl version is this? I was under the impression
> libcurl
> doesn't behave like that in recent versions.

Thanks for the response, Daniel.

After putting a breakpoint on curl_easy_setopt, I double-checked to see all
options that are being set. Neither COOKIEFILE nor COOKIEJAR are being set.
Following are the ones that are being set:

CURLOPT_CAINFO
CURLOPT_CAPATH
CURLOPT_FOLLOWLOCATION
CURLOPT_HEADERFUNCTION
CURLOPT_NOPROGRESS
CURLOPT_PROGRESSDATA
CURLOPT_PROGRESSFUNCTION
CURLOPT_SHARE
CURLOPT_SSL_VERIFYHOST
CURLOPT_URL
CURLOPT_USERAGENT
CURLOPT_VERBOSE
CURLOPT_WRITEDATA
CURLOPT_WRITEFUNCTION
CURLOPT_WRITEHEADER

Could any of these be causing a problem?

My libcurl version is 7.13.1-3.

Thanks,
Ashutosh
Received on 2006-04-05