首页 > 代码库 > curl 传递用户session

curl 传递用户session

$cmh = curl_multi_init();
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIE, ‘PHPSESSID=‘ . $_COOKIE[‘PHPSESSID‘]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_TIMEOUT, 1);
curl_multi_add_handle($cmh, $ch);
curl_multi_exec($cmh, $active);
echo "-------------End---------------\n";
/*
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIE, ‘PHPSESSID=‘ . $_COOKIE[‘PHPSESSID‘]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_TIMEOUT, 1);
curl_exec($ch);
curl_close($ch);
echo "ss";

curl 传递用户session