curl-library
Re: Getting a cookie sent by a server
Date: Tue, 9 Oct 2001 14:48:54 +0200 (MET DST)
On Tue, 9 Oct 2001, Gilles Talbot wrote:
> how do i get a cookie sent by a server, after i have used
> curl_easy_perform ?
Well, it depends on how you want it.
You can set a callback to get all headers. You'll then get called once for
every header and you'll have to figure out yourself when a cookie is
received.
If you only want to re-use any possible cookies in a second request, you can
store all headers in a file and use CURLOPT_COOKIEFILE in the subsequent
requests.
Starting with libcurl 7.9 CURLOPT_COOKIEJAR can be used to store all known
cookies in a netscape formatted cookie file.
There is unfortunately no special cookie-callback or something like that to
get to know only about (particular) cookies. It is a listed TODO item.
> I'm using curl 7.8
You should consider upgrading to 7.9.
-- Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/Received on 2001-10-09