首先我从 VUGen 运行它(它是手工构建的):
Action()
{
web_cleanup_cookies();
web_cache_cleanup();
web_url("entrypoint",
"URL=http://e34jbsl00430.devillo.com:8080/entrypoint/",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
return 0;
}
该页面无法打开,并且 URL 中出现了 sessionid。可能在一些重定向之后。
在打开 FireBug 的 Firefox 中手动执行此操作时,我得到以下请求/响应标头:
Response Headers
Cache-Control no-cache, no-store
Content-Length 0
Date Fri, 19 Apr 2013 13:49:51 GMT
Expires Thu, 01 Jan 1970 00:00:00 GMT
Location http://e34jbsl00430.devillo.com:8080/entrypoint/?0
Pragma no-cache
Server Apache-Coyote/1.1
Set-Cookie ENTRYPOINT_JSESSIONID=WgfuCXmTF7VTCsmhWYvU-WY7; Path=/entrypoint; HttpOnly
X-Frame-Options DENY
Request Headers
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding gzip, deflate
Accept-Language no,en-gb;q=0.7,en;q=0.3
Connection keep-alive
Cookie ENTRYPOINT_JSESSIONID=DnVj0xzyLaUOKfUEFIP6bpF-
Host e34jbsl00430.devillo.no:8080
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1
然后我运行相同的脚本,但web_add_header("Cookie","ENTRYPOINT_JSESSIONID=dummy");
它工作得很好。
为什么要将此虚拟标头添加到我的脚本中才能使其正常工作?