cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: setting cookies before curl_easy_peform() doesn't seem to work for me.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 29 Mar 2003 09:13:13 +0100 (CET)

On Fri, 28 Mar 2003, Derek Ealy wrote:

> I'm developing a CGI in which I am using libCurl to access another URL. I
> need to pass along the cookies (session IDs and such) to this URL I am
> accessing w/libCurl. The problem is though that they don't appear to be
> passed along, meaning that the servlets on the other side aren't seeing
> these cookies that were set when my CGI was called.

How do you know they're not passed along? Have you used VERBOSE or
DEBUGFUNCTION to get to see what is sent?

> curl_easy_setopt(curl_handle, CURLOPT_URL, "https://xx.com/servlet");
> string cookies = "ONTCred=1235;JSESSIONID=abc123";
> curl_easy_setopt(curl_handle, CURLOPT_COOKIE, cookies.c_str());

Looks correct to me.

> curl_easy_perform() returns 0, but like I said it is as if the cookies never
> arrive. Obviously I've misunderstood how to do this? Any ideas?

You need to show us what the request libcurl uses actually look like.

Also, I trust that you're using a fairly recent version of libcurl. You
didn't mention any version in your mail.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
Received on 2003-03-29