PHP curl调用接口,在接口里写cookie发现没有写入? 5
调用cookie没写//调用<?php$ch=curl_init();curl_setopt($ch,CURLOPT_URL,'http://www.test.com/c...
调用cookie没写
//调用
<?php$ch = curl_init();curl_setopt($ch,CURLOPT_URL, 'http://www.test.com/c.php?cc=fffxxx');curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);curl_setopt($ch,CURLOPT_TIMEOUT_MS,1);$ccc= curl_exec($ch);curl_close($ch);接口:c.php<?phpsetcookie('testcook', $_GET['cc'], time() + 1209600, '/', '.test.com');?> 展开
//调用
<?php$ch = curl_init();curl_setopt($ch,CURLOPT_URL, 'http://www.test.com/c.php?cc=fffxxx');curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);curl_setopt($ch,CURLOPT_TIMEOUT_MS,1);$ccc= curl_exec($ch);curl_close($ch);接口:c.php<?phpsetcookie('testcook', $_GET['cc'], time() + 1209600, '/', '.test.com');?> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询