Home > Backend Development > PHP Tutorial > PHP模拟登陆网站出现会话超时

PHP模拟登陆网站出现会话超时

WBOY
Release: 2016-06-23 14:16:30
Original
1120 people have browsed it

<?php        $url="http://60.219.165.24/loginAction.do";        $ch = curl_init();        curl_setopt($ch, CURLOPT_URL, $url);        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);	curl_setopt($ch, CURLOPT_HEADER, 0); 	curl_setopt($ch, CURLOPT_POST, 1);	$curlPost="postdata";	curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);         curl_setopt($ch, CURLOPT_UNRESTRICTED_AUTH, 1);         $output = curl_exec($ch);         curl_close($ch);$home_url = 'http://60.219.165.24/gradeLnAllAction.do?type=ln&oper=fainfo&fajhh=2615';	  header('Location: '.$home_url);?>
Copy after login

传入了正确的登陆名称和密码之后却无法访问下一页面。提示“会话超时".

抓包如上图


回复讨论(解决方案)

没看到你post的用户名密码数据?

还有,你保持会话状态了么?curl会自动帮你传递cookie?

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template