cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: getting/setting cookies

From: Guillaume Arluison <ga_at_lacde.net>
Date: Fri, 17 Dec 2004 14:56:30 +0000

That would be indeed really nice.

For the moment I'm dealing with the cookie files and editing them
on-the-fly. (delete/set a row)
A memory version will be obviously more interesting !

> To remove a cookie that libcurl already knows about, you simply set
it with no contents,
As usual in php..., it's fine yes.

>I'm not sure how to clear all known cookies easily, or even if that is
a desired feature.
Why not using the curl_easy_setopt CURLOPT_COOKIELIST with a NULL value
? Or do you think it may be confusing with "no-op" ?

For the use of curl_easy_setopt CURLOPT_COOKIELIST (said with the same
format as cur_easy_getinfo) you meant only the cookies that are in the
curl_slist provided will now be used OR (preferably for me) the cookies
already retrieved that are in the list are modified and the others kept
as is ? That may sounds obvious but that's nice to say it in the future doc.

G.

Daniel Stenberg wrote:

> Hi
>
> I have this suggestion on a simple get/set cookies interface for
> addition to libcurl:
>
> curl_easy_getinfo() - CURLINFO_COOKIELIST to get a curl_slist with all
> known cookies (netscape/mozilla cookie file formatted)
>
> curl_easy_setopt() - CURLOPT_COOKIELIST to set a list of cookies
> (using the same format as above or HTTP-header style - both are
> supported)
>
> To remove a cookie that libcurl already knows about, you simply set it
> with no contents, or you set it with an expired time.
>
> I'm not sure how to clear all known cookies easily, or even if that is
> a desired feature.
>
> Opinions? Thoughts? Other ideas?
>
> This is much simpler than our previous cookie API discussions, but I
> think simplicity is to prefer here.
>
Received on 2004-12-17