Help: libcurl doesn't fetch cookie when r ediect HTTP (httpcode is 302) client.
Date: Tue, 8 May 2007 14:19:13 +0800 (CST)
set libcurl auto redirectiion and cookie as follow:
curl_easy_setopt(handle, CURLOPT_FELLOWLOCATION, 1);
curl_easy_setopt(handle, CURLOPT_COOKIE, strCookie);
When a browser requests a web page, then it receives HTTP 302 response. If the HTTP header of the response include "Set-cookie: Session1=SessionValue1", then libcurl doesn't fetch cookie again from strCookie, so web server authorization is failed because of empty cookie in the new request header. But on the other condition libcurl fetches cookie correctly.
I think libcurl should try to fetch cookie again after the location has been changed.
Received on 2007-05-08