cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: cookie sending in url

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 6 May 2003 11:51:59 +0200 (CEST)

On Mon, 5 May 2003, bart vanherck wrote:

> curl --proxy proxy.pandora.be:8080 -o one.html -L -D ./cookie2
> -d"uid=xxx&pwd=yyyy&goto=http:%2F%2F:www.telenet.be"
> https://www.telenet.be/sys/sso/exec_login.php

I'd recommend use '-c cookie2' instead of -D. It makes the cookie operation
slightly more accurate, which can make a difference in border cases.

> curl --proxy proxy.pandora.be:8080 -o two.html -L -b ./cookie2
> "https://www.telenet.be/sys/sso/jump.php?https://services.telenet.be/isps/MainServlet?ACTION=TELEMTR&SSOSID=f832a44aab631ba51acfe714a05faad7ae4e8d445536cf12"
>
> My problem is how I can do this in libcurl. Is there a way to get a
> cookie ? because if I use the following code :

[setopts cut out]

> curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "/tmp/telemeter.cookie");
> res=curl_easy_perform(curl);

CURLOPT_COOKIEFILE is used for reading cookies from a given file. If you want
to write cookies to a file, you should use CURLOPT_COOKIEJAR. You can use
both at the same time just fine (it will then read the file first and then
later write the file with the updated info).

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-05-06