前辈们,求指教,关于cookie的问题, 各位前辈们,你们好.我的问题是这样的. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我用Firefox的开发工具 获取到了一个网站登录后的cookie,随后我写了一个方法,携带着登录后的cookie,获取页面源代码,但是仍然不是登录后的页面源代码不知道为什么,想请教前辈们, 随后是一些相关信息.一,获取的方法是这样的 //进行登陆后的操作 GetMethod getMethod = new GetMethod(dataUrl);//每次访问需授权的网址时需带上前面的 cookie 作为通行证 getMethod.setRequestHeader("cookie",tmpcookies); httpClient.executeMethod(getMethod); String text = getMethod.getResponseBodyAsString(); System.out.println(text);二,网站是 bbs.21ic.com三,通过firefox获取到的cookie如下:1.登录url 也就是post的url:http://passport2.21ic.com/logging.php?action=login&index=1&loginsubmit=yes2.Connection Keep-Alive Content-Encoding gzip Content-Length 2559 Content-Type text/html; charset=UTF-8 Date Tue, 30 Oct 2012 03:42:02 GMT Keep-Alive timeout=15, max=100 Server Apache Set-Cookie aSr_cookietime=deleted; expires=Mon, 31-Oct-2011 03:42:01 GMT; path=/; domain=.21ic.com www_username=fangbaobin; path=/; domain=.21ic.com aSr_auth=ad7cFmczlqGK2spLHBD7cMT94g0nk8QxZ%2B6XZIqid18e1Mh9wSHG8xcf3mxlwWpg2OWP2SgEZl5H2ksRrtNZIJKwsWN7; path=/; HttpOnly; domain=.21ic.com aSr_loginuser=deleted; expires=Mon, 31-Oct-2011 03:42:01 GMT; path=/; domain=.21ic.com aSr_activationauth=deleted; expires=Mon, 31-Oct-2011 03:42:01 GMT; path=/; domain=.21ic.com aSr_pmnum=deleted; expires=Mon, 31-Oct-2011 03:42:01 GMT; path=/; domain=.21ic.com Vary Accept-Encoding我直接将Set-Cookie的参数 声明一个字符串(tmpcookies),用上面的获取方法获取,为什么会得不到登录后的源代码呢??? myeclipse8.5如何添加Tomcat7 struts2重复提交 VPN,相关远程登录问题 --->>>请问hibernate里面的hql not in 带参数怎么写? struts相关问题 jsp web生成word文档时出现乱码?《十万火急》 请教:怎样引入jdom函数包? web service 开发用哪种语言较多,JAVA还是.net?用ASP可以吗? 关于Swing的电子文档问题?请各位高手指点! ejb的部署问题 有做 Google Appengine 开发的么?有个关于调试的问题。 spring的代理是什么意思,书上说的不太好理解
随后我写了一个方法,携带着登录后的cookie,获取页面源代码,但是仍然不是登录后的页面源代码
不知道为什么,想请教前辈们, 随后是一些相关信息.一,获取的方法是这样的
//进行登陆后的操作
GetMethod getMethod = new GetMethod(dataUrl);
//每次访问需授权的网址时需带上前面的 cookie 作为通行证
getMethod.setRequestHeader("cookie",tmpcookies);
httpClient.executeMethod(getMethod);
String text = getMethod.getResponseBodyAsString();
System.out.println(text);二,网站是 bbs.21ic.com
三,通过firefox获取到的cookie如下:
1.登录url 也就是post的url:
http://passport2.21ic.com/logging.php?action=login&index=1&loginsubmit=yes
2.Connection Keep-Alive
Content-Encoding gzip
Content-Length 2559
Content-Type text/html; charset=UTF-8
Date Tue, 30 Oct 2012 03:42:02 GMT
Keep-Alive timeout=15, max=100
Server Apache
Set-Cookie aSr_cookietime=deleted; expires=Mon, 31-Oct-2011 03:42:01 GMT; path=/; domain=.21ic.com www_username=fangbaobin; path=/; domain=.21ic.com aSr_auth=ad7cFmczlqGK2spLHBD7cMT94g0nk8QxZ%2B6XZIqid18e1Mh9wSHG8xcf3mxlwWpg2OWP2SgEZl5H2ksRrtNZIJKwsWN7; path=/; HttpOnly; domain=.21ic.com aSr_loginuser=deleted; expires=Mon, 31-Oct-2011 03:42:01 GMT; path=/; domain=.21ic.com aSr_activationauth=deleted; expires=Mon, 31-Oct-2011 03:42:01 GMT; path=/; domain=.21ic.com aSr_pmnum=deleted; expires=Mon, 31-Oct-2011 03:42:01 GMT; path=/; domain=.21ic.com Vary Accept-Encoding
我直接将Set-Cookie的参数 声明一个字符串(tmpcookies),用上面的获取方法获取,为什么会得不到登录后的源代码呢???