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

curl-and-php

Re: Problem with saving "no-named" cookies

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

2007/9/2, Daniel Stenberg <daniel_at_haxx.se>:
> 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)) {
$cookie=$r[1];
}

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

Thanks for help.
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-09-03