cURL / Mailing Lists / curl-library / Single Mail

curl-library

Redirect & cookie

From: Jacky Lam <sylam_at_emsoftltd.com>
Date: Thu, 21 Mar 2002 17:57:33 +0800

Hi,

        I have two problems on using cookie.

        First is that, my program is a multi-thread download program. Each for them
may learn new cookies upon downloading. But they need to share the cookie
information. However, if I use CURL_SETOPT_COOKIEJAR to store the cookies for
different threads, the cookie files will be corrupted (some new cookies will
be overwritten by old one). Is there any clever way to overcome this problem?
        
        Second, I try to solve the above program by using a shared structure to
store my cookie. So, I need to use CURL_SETOPT_COOKIE to set my cookie on
each request. However, if the cookie is learnt from a HTTP redirent response
and I have used CURL_SETOPT_FOLLOWLOCATION, it seems that the library doesn't
have any mean for me to set cookie for the redirected request. Besides, I
handle the redirection by myself, is there any way to do that easily?

        Thx.

Jacky
Received on 2002-03-21