curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Use of cookies

From: Mac-Fly via curl-library <curl-library_at_cool.haxx.se>
Date: Mon, 06 Apr 2020 13:40:43 +0200

Dear all,

I am trying to use cookie interface but I am probably missing something obvious.

What I do (note that I want to limit the cookies for each libCURL call to a minimum):
(...after the usual initialisation...)
I call:
- curl_easy_setopt([CURL_handle], CURLOPT_COOKIEFILE, ""); >> to start-up the engine
- curl_easy_setopt([CURL_handle], CURLOPT_COOKIELIST, "ALL"); >> to delete all existing cookies
- curl_easy_setopt([CURL_handle], CURLOPT_COOKIELIST, cookie); >> using a Netscape-like syntax for "cookie"
- curl_easy_perform([CURL_handle]); >> to launch the call
- curl_easy_getinfo([CURL_handle], CURLINFO_COOKIELIST, &cookie_list); >> to see what are the cookies recognised

What I see is:
- the list of cookies is ever growing and not being reset
- it never contains the cookies I set.

I would expect to see:
- only the list of cookies of the homepage I was calling
- my own cookie is part of the list.

I am pretty (!) sure the syntax of the cookie I am trying to set is correct, I even tried the one of the example of libCURL.

What am I doing wrong?

Best regards
Morten.

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-04-06