cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: cookie interface suggestion

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 19 Jun 2003 15:47:42 +0200 (CEST)

On Thu, 19 Jun 2003, Cris Bailiff wrote:

> From my point of view, I'm quite happy for libcurl to 'manage' the cookie
> jar (adding cookies to it on reception, picking the cookies to use for each
> request, expiring them etc.). What I would like as a feature, though, is the
> ability to LOAD and SAVE the jar from other than a flat file.
>
> I would like to just be able to ask for the string version of the jar (the
> file contents)

You mean a big chunk of data, looking just like a cookie jar file does?

> or by getting a (public) API to the internal structure to iterate through
> and store the cookies.

You can do that with the GET option in my draft.

> I could do the same kind of thing with the RECVFUNC/SENDFUNC, but it seems a
> shame to duplicate all that cookie logic that libcurl handles. I don't need
> to work out which cookies should be in the request - I just want to put the
> jar away in a database between requests, not in a file.
>
> Loading the jar isn't such a big - Ideally, I'd just hand the jar contents
> back as a string (and have libcurl parse it as normal), but I could feed them
> in one by one if necessary (but, like I said, I'd like libcurl to choose
> which ones are needed, not me.)

I think the one-by-one approach makes more sense, as that allows the
application to decide how/if/where each cookie is stored and also exactly
which cookies that are sent back to libcurl at a later time. If it wants to.

Passing "cookie jar" file formatted contents back and forth would only make
sense if the cookies always are to be treated as an opaque lump.

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
Received on 2003-06-19