cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl does not update cookie

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 24 May 2015 20:07:20 +0200 (CEST)

On Sun, 24 May 2015, Alexander Dyagilev wrote:

>> So what happens?
>
> The same thing I've reported.

I thought you initially reported that libcurl sent two cookie headers with
your program and now it doesn't do that anywmore. In my eyes, that is not the
same thing.

> Cookie: test_cookie_2=value2; test_cookie_2=base_value2

Ah, I suspect this happens because...

> curl_easy_setopt (m_curl, CURLOPT_COOKIELIST, "Set-Cookie:
> test_cookie_2=base_value2");

Doesn't specify domain or path so libcurl sets a default set derived from the
URL, which probably aren't identical to what the cookie you receive from the
site gets so they get stored as two separate cookies by libcurl, but using the
same name. A rather peculiar behavior, but defined in the spec. But I can't
immediately spot why they would end up different.

I supect that either enabling VERBOSE or perhaps getting the cookies stored
with CURLOPT_COOKIEJAR will make the differences between the two cookies
notable.

It could of course also be a bug in libcurl that makes this happen. I can't
rule that out.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2015-05-24