cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Enabling cookies without a file

From: Dave Dribin <dave-ml_at_dribin.org>
Date: Tue, 1 Mar 2005 21:01:53 -0600

On Mar 1, 2005, at 6:58 PM, Dan Fandrich wrote:
> On Tue, Mar 01, 2005 at 06:05:44PM -0600, Dave Dribin wrote:
>> I'm using libcurl as a cross platform HTTP library (current targets
>> are
>> Windows, Linux and OS X). We need to use cookies, but do not need to
>> store them in a file.
>
> If you want to track cookies yourself, you can insert them in the
> request
> using CURLOPT_COOKIE. A better cookie API is on the libcurl TODO list.
> The latest thoughts on the subject are in the thread starting at
> http://curl.haxx.se/mail/lib-2004-12/0195.html

I don't want to track cookies in our app. libcurl does a fine job of
handling them automatically, but requires an external file, sort of. I
say "sort of" because the current API allows you to specify an
nonexistent file (a.k.a fopen() fails), in which case libcurl handles
all cookies "in memory" only. I guess I'm proposing passing the empty
string to CURLOPT_COOKIEFILE as the standard, cross-platform way to
enable in memory only cookie handling.

-Dave
Received on 2005-03-02