$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://218.206.191.82/ESOPWeb/ResourceManage/m400/getSpecialQuery.do?_dc=1353327229302&libNumber=4001&categoryId=1&libStatus=&qtype=2&page=3&start=34&limit=17');
curl_setopt($curl, CURLOPT_COOKIE, 'ESOPUSER=GZZERUNAGENT_00;JSESSIONID=sdC2TDCCSK5PYVRJ76K2mpQ1LTLqY2z9MJnDpJMdbFjxFRpRTQDk!-1353327229!302748');
// curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$str = curl_exec($curl);
curl_close($curl);
var_dump($str);
返回
<html>
<head>
<script language="javascript">
function jumpTo_login() {
window.location.href="/ESOPWeb/Login/begin.do";
}
</script>
</head>
<body onload="jumpTo_login();">
</body>
</html>
得不到想要的数据 是哪里出了问题,求助?
------解决方案--------------------
在你传递的 cookie 数据中有 JSESSIONID 变量
而 session 是有实效的,当你用其他方式获得 sessionid 时,实际上已是过期的了