cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Sharing of cookies between easy handles

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 24 Aug 2008 10:42:09 +0200 (CEST)

On Sat, 23 Aug 2008, Dmitriy Sergeyev wrote:

> I'm using libcurl 7.18.2 and have faced with problem of sharing cookies

> curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE |
> CURL_LOCK_DATA_DNS);

Just note that in 7.18.2, libcurl is sharing DNS cache between all easy
handles within the same multi interface by default.

> The libcurl documentation sais: "If you add a share that is set to share
> cookies, your easy handle will use that cookie cache and get the cookie
> engine enabled." Thus I'm expecting libcurl to automatically
> process/store/receive cookies. And reading several posts in this mailing
> list, it seems that it should be like this. But the SECOND request doesn't
> contain any "Cookie" headers. :(
>
> The pseudo code I provided is the only resulting sequence of actions
> performed in single thread by my curl-wrapper component. It quite bulky so I
> suppose you don't like to see it. But if you wish, I could implement
> standalone mini sample, which does the same. However just want to ensure
> first, that the sequence is correct and it really should done what I'm
> expecting.

I don't have any example for this lying around. It would help if you would
provide a stand-alone example for what you have done so far (that doesn't
work) and then we can take that and extend or possibly debug to make a working
example out of it!

-- 
  / daniel.haxx.se
Received on 2008-08-24