cURL / Mailing Lists / curl-library / Single Mail

curl-library

Modify cURL to store cookies in variable

From: Rodrigo <godz.g89_at_gmail.com>
Date: Fri, 17 May 2013 16:51:30 -0300

Hello, my name is Rodrigo. I'm currently trying to make a PHP script
with cURL that needs to store cookies, I tried to use the "normal"
cookie file with CURLOPT_COOKIEJAR and CURLOPT_COOKIEFILE but I am using
parallel connections and need the cookie immediatly after the request
was made. I search a lot and noticed there isn't a standard way to store
cookies in variables, so I decided to try to modify cURL source to
implement this.

What I had in mind was to check how cookies where written to files with
CURLOPT_COOKIEJAR but instead of writing the cookies to files, returning
them so they could be stored in variables, I would like to do something
like this in PHP:

curl_setopt($handle, CURLOPT_COOKIEVAR, $cookie);

Where CURLOPT_COOKIEVAR would be the name of the option to store cookies
in variables and $cookie would store the cookie in a string.

So, my question is, any idea of where in cURL's source CURLOPT_COOKIEJAR
is implemented?

Thanks in advance.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-05-17