cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Derek Ealy <dealy663_at_hotmail.com>
Date: Mon, 31 Mar 2003 08:20:07 -0800

I'm using version 7.8.1.

CURLOPT_VERBOSE shows
...
>GET /logout HTTP/1.1
Cookie:
ONTCred=299963d6eef7c13d2dc7781274a2847258acb7c4fb41511e32e88b154ae3987c84b21a7d27d52e00b860a13289a3bdac6948c2aa3a85e296eb20bd1b831358ed72390831864d50dd12d0302d7a8fa773;WebLogicSession=PoR2d3xCWz39xPq4p46iRknoP2BZJ4Ga0ZHhRlwBwJmArv2JxaoJ|-798081241419992642/-1408171059/6/10023/10023/7002/7002/10023/-1;
Host: pooka.itgssi.com:10023
...

I'm wondering if the problem may be that there is no domain specified with
the cookies. Is there a way for me to set the cookie domain, path, version
etc?

Thanks, Derek

----Original Message Follows----
From: Daniel Stenberg <daniel_at_haxx.se>
Reply-To: curl-library_at_lists.sourceforge.net
To: libcurl Mailing list <curl-library_at_lists.sourceforge.net>
Subject: Re: setting cookies before curl_easy_peform() doesn't seem to work
for me.
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
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail
-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
Received on 2003-03-31