curlopt_cookie问题
我使用curlopt_cookie 发现前一个cookie会覆盖后一个cookie。。而且写法上也出现了问题,打印的结果不是想要的,不正确的
$postdata = array(
'zipcode' => '12345',
'langid' => '-1',
'storeid' => '10001',
'url' => '/brother-tn-580-toner-cartridge-high-yield/product_612784',
'errorurl' => 'zipcode'
);
$ua = 'mozilla/5.0 (windows; u; windows nt 5.1; ru; rv:1.9.1.3) gecko/20090824 firefox/3.5.3 (.net clr 3.5.30729)';
$url = 'http://www.staples.com/brother-tn-580-toner-cartridge-high-yield/product_612784';
$host = $_server['document_root'];
if ( $curl = curl_init() )
{
curl_setopt($curl, curlopt_url, 'http://www.chenzhi.com/2.php');
curl_setopt($curl, curlopt_cookie, 'coreid6=30201255514912193294815;path=/;domain=www.chenzhi.com;expires=mon, 13-oct-24 13:08:16 gmt');
curl_setopt($curl, curlopt_cookie, 'testsess3=x;path=/;domain=www.chenzhi.com;expires=end of session');
curl_setopt($curl, curlopt_cookie, '90028341_login=1255528626018461671490028341;path=/;domain=www.chenzhi.com;expires=end of session');
curl_setopt($curl, curlopt_cookie, '90028341_reset=1255528626;path=/;domain=www.chenzhi.com;expires=end of session');
curl_setopt($curl, curlopt_followlocation, true);
curl_setopt($curl, curlopt_returntransfer, false);
curl_exec($curl);
curl_close($curl);
} else {
die('1 fails:' . curl_error($curl));
}
unset($curl);
打印的结果
array
(
[90028341_reset] => 1255528626
[path] => /
[domain] => www.chenzhi.com
[expires] => end of session
)
而正常的setcookie显示的结果确是
1
[testcookie2] => 2
[testcookie3] => 3
[testcookie4] => 4
)
请问大神们如何把多个cookie的值用curlopt_cookie写出来??求解
cookie curl