cURL / Mailing Lists / curl-library / Single Mail

curl-library

Problem with cookie

From: Mandar Wadekar <MandarW_at_HeyAnita.com>
Date: Thu, 11 Apr 2002 00:25:43 -0700

Hello,

I am new to this list. Before posting, I tried to search the list for
the problem I have. I couldn't find much. Anyway, here is my problem.

OS : Win NT 4
Compiler : MSVC++ 6.0
CURL version : 7.9.5

Here is my code :

curl_global_init(CURL_GLOBAL_WIN32);

CURL *curl;
CURLcode res;
FILE* vxmlFile;
curl = curl_easy_init();

if(curl)
{
                                vxmlFile = fopen(vxml,"w+");

        
curl_easy_setopt(curl,CURLOPT_VERBOSE,TRUE);
                                curl_easy_setopt(curl,CURLOPT_URL,
name);
                                curl_easy_setopt(curl,CURLOPT_FILE,
vxmlFile);

                                char *cookieFileName =
"c:\\cookie-jar\\cookie.ck" ;
                                curl_easy_setopt(curl,CURLOPT_COOKIEJAR,
cookieFileName );
        
curl_easy_setopt(curl,CURLOPT_COOKIEFILE, cookieFileName );

                                res = curl_easy_perform(curl);

 
                                curl_easy_cleanup(curl);

                                if (res==0)
                                {
                                        fclose(vxmlFile);
                                }
}

All I am doing is enabling cookie-parser. I can even see the cookie
received, being saved in cookie.ck file, for the first request. For the
next request, cookie would be automatically sent. But that does not
happen. After setting VERBOSE, curl spits out the header that is being
sent. But I do not see the cookie being sent. I even tried using
CURLOPT_COOKIE option, by setting the cookie myself. The result was
worst. The server rejected the request (Response from server : Malformed
syntax).

Am I obviously missing something here? I would really appreciate if I
get some pointers.

Thanks,

-Mandar Wadekar
Received on 2002-04-11