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


Re: Problem with saving "no-named" cookies

From: Paweł Hrycyk <>
Date: Mon, 3 Sep 2007 09:06:50 +0200

2007/9/2, Daniel Stenberg <>:
> As far as I know, a cookie can't exist without a name so you're talking about
> an invalid header here.

Maybe you are right. Maybe progrmmer of this site use this trick for secure.

> Are browsers fine with this (in my view very weird) input?

Yes, my browsers (Mozilla Firefox and Internet Explorer) are fine with this.

I found solution to my problem.
First I have to read the invalid header i save this cookie:
$pattern = 'Set-cookie: ([a-zA-Z0-9]*);';
if(ereg($pattern, $curl->header, $r)) {

And now I can use it like this:
curl_setopt($this->c, CURLOPT_HTTPHEADER, 'array(Cookie: '.$cookie.')');

Thanks for help.
Received on 2007-09-03