Re: cURL & cookies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, April 25, 2006 11:50 am, Eric Butera wrote:
> On 4/25/06, Richard Lynch <ceo@xxxxxxxxx> wrote:Oh, and here's the
> REAL
> problem:
>
>>
>> If you use CURLOPT_HEADER, 1, then, like, for some reason beyond my
>> ken, the COOKIEJAR/COOOKIEFILE stuff just plain doesn't get done.

> On an application I was forced to write, the goal was to create an
> interface
> to another system on another server.  I used cURL to grab the pages.
> Their
> system sent three cookies and used tons of redirects to set their
> session
> and validate logins.  So basically I ended up with something like
> this:
>
> define('_COOKIEJAR',     '/tmp/cjar_'. session_id());
> define('_COOKIEFILE',     _COOKIEJAR);
>
> curl_setopt($curl, CURLOPT_COOKIEJAR, _COOKIEJAR);
> curl_setopt($curl, CURLOPT_COOKIEFILE, _COOKIEJAR);
> curl_setopt($curl, CURLOPT_HEADER, TRUE);
> curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);

> My point is that I have headers turned on and the cookie jar files get
> wrote
> to /tmp.  So am I misunderstanding that you said it is one or the
> other?
>
> Let me know if I'm wrong, thanks!

Sounds to me like we have different versions of cURL and yours is
better. :-)

Mine phpinfo() curl section has:
libcurl/7.15.3 OpenSSL/0.9.7d zlib/1.2.1

which would seem to be the most current version...

Or, perhaps, the order in which you set the options matters?  Ick.

For me, at least, the Cookie jar did not work until I took out the
CURLOPT_HEADER, and it DID work after I changed that, and only that.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux