dongsi0625 2014-11-21 16:58
浏览 29
已采纳

Php Curl Cookie登录

Hi i need to login to webpage using cookie the cookie is in this format key=login value=id=3694385&pw=d9d51ab066c09c2404&cks=bfb964 Here is my code for login but it fails to login using this cookie.(Note cookie is constant for 24 hrs and i dont want to login using username and password)

Here is my code

<?php
$curl = curl_init('http://up.net/');
echo $curl;
curl_setopt($curl, CURLOPT_VERBOSE, 1);
curl_setopt($curl, CURLOPT_COOKIE, 'login=id=3694385&pw=d9d51ab066c09c2404&cks=bfb964');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$page = curl_exec($curl);
curl_close($curl);
echo $page;
?>
  • 写回答

1条回答 默认 最新

  • duanrenchuo9244 2014-11-21 17:00
    关注

    your cookie format is wrong. Cookies are delimited by semicolons, not ampersands.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 VB.NET操作免驱摄像头
  • ¥15 笔记本上移动热点开关状态查询
  • ¥85 类鸟群Boids——仿真鸟群避障的相关问题
  • ¥15 CFEDEM自带算例错误,如何解决?
  • ¥15 有没有会使用flac3d软件的家人
  • ¥20 360摄像头无法解绑使用,请教解绑当前账号绑定问题,
  • ¥15 docker实践项目
  • ¥15 利用pthon计算薄膜结构的光导纳
  • ¥15 海康hlss视频流怎么播放
  • ¥15 Paddleocr:out of memory error on GPU