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

curl-and-php

Re: Bug or strange behavior with CURLOPT_COOKIE: cookie value disappears

From: Richard Lynch <ceo_at_l-i-e.com>
Date: Thu, 27 Mar 2008 20:01:00 -0500 (CDT)

On Mon, March 24, 2008 7:49 am, Mikkel T. Kromann wrote:
> When I try to use CURLOPT_COOKIE I'm not able to set the value of the
> cookie to anything but empty (print_r($_COOKIE) shows only the cookie
> name as key, while the value is empty).

That seems pretty weird...

> # This is the contents of target.php
> <?php print_r($_COOKIE); ?>
>
> # This is the contents of wrapper.php
> <?php
> print "This is the $_COOKIE array output by target.php \r\n";
> $ch = curl_init("http://10.0.0.4/cURLtest/target.php");
> curl_setopt($ch, CURLOPT_COOKIE, "id=242; ");

I have this vague notion that maybe you ought to have:
$array('id'=>242);
as the last arg...

If so, and if curl/php are nuking everything after 'id' because it's
not a valid PHP variable name, which would be a holdover behaviour
from the bad ol' days of register_globals "ON", it would make sense of
this from a Big Picture.

This is mostly speculation...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-03-28