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


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

From: Richard Lynch <>
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("");
> curl_setopt($ch, CURLOPT_COOKIE, "id=242; ");

I have this vague notion that maybe you ought to have:
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.
Yeah, I get a buck. So?
Received on 2008-03-28