cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Storing cookies from curl into a variable..

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 15 Nov 2002 08:52:54 +0100 (MET)

On Thu, 14 Nov 2002, Aaron Chan wrote:

> I would like to store the cookies returned from curl into a variable
> instead of a file. Setopt cookiejar only provides an argument for a
> filename, is there a way to route this to a variable?

Nope, not as easy and quick as you'd want. You'll probably need to store it
to a file and then read it back, parse it and assign the proper variables
accordingly.

> I know I can setopt to return full headers and parse the cookies from
> there, but if possible, I'd rather get it from cookiejar.

There's this item in the TODO of the curl project to introduce an API to
libcurl that would offer applications (such as the PHP/CURL module) better
and easier access to the cookies that libcurl stores/parses/understands, but
so far no one has suggested nor written anything in that direction.

I'm open for suggestions on how this could be done in the future.

I am not a PHP hacker.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html
Received on 2002-11-15