苏飞论坛

标题: webBrowser获取完整cookie,并把cookie传给httpHelper, [打印本页]

作者: xiaomazhu    时间: 2013-11-29 13:31
标题: webBrowser获取完整cookie,并把cookie传给httpHelper,
本帖最后由 xiaomazhu 于 2013-11-29 13:33 编辑

webBrowser获取完整cookie,并把cookie传给httpHelper,用get获取数据,但获取数据的过程中会发生跳转,我设置了Allowautoredirect = true,最后数据是获取到了,但马上会跳出了系统回到了登录页,不懂是cookie失效还是什么问题,请各路大神帮帮忙!

http://g1.ts698.com/game/checkGa ... &reportType=hDaily&
跳转为


http://ttbgs1.ts698.com/daily/ag ... &reportType=hDaily&
但直接访问
http://ttbgs1.ts698.com/daily/ag ... ortType=hDaily&

却是无法访问的。




作者: 站长苏飞    时间: 2013-11-29 13:51
Allowautoredirect = true是不带Cookie的,要手动带Cookie跳转才有效果
作者: xiaomazhu    时间: 2013-11-29 14:16
站长苏飞 发表于 2013-11-29 13:51
Allowautoredirect = true是不带Cookie的,要手动带Cookie跳转才有效果

那要怎么样操作呢?要手动带Cookie跳转才有效果??

作者: 站长苏飞    时间: 2013-11-29 14:19
先设置Allowautoredirect = false获取重定向到的网址,然后带Cookie再去访问
作者: ro4ters    时间: 2013-11-29 14:30
cookie 不完整.看看对方是不是有设置httponly
作者: xiaomazhu    时间: 2013-11-29 14:35
站长苏飞 发表于 2013-11-29 14:19
先设置Allowautoredirect = false获取重定向到的网址,然后带Cookie再去访问

设置Allowautoredirect = false访问
http://g1.ts698.com/game/checkGa ... &reportType=hDaily&
无法获取重定向到的网址

作者: wxfy2011    时间: 2013-12-13 10:41
我遇到和你一样的问题,还不知道怎么解决呢
作者: 站长苏飞    时间: 2013-12-13 10:46
@wxfy2011 @xiaomazhu 看看Header里有没有,不可能没有的
作者: wxfy2011    时间: 2013-12-13 11:07
站长苏飞 发表于 2013-12-13 10:46
@wxfy2011 @xiaomazhu 看看Header里有没有,不可能没有的

我的header里面是这个
+        _Header    {Vary: Accept-Encoding
SD: D=603
ST: t=1386903618888293
X-Content-Type-Options: nosniff
X-XSS-protection: 1;mode=block
Connection: close
Content-Length: 0
Content-Type: text/html
Date: Fri, 13 Dec 2013 03:00:18 GMT
Location: https://login.alibaba-inc.com/ss ... ONTEXT_PATH=%2Fnoah

}    System.Net.WebHeaderCollection



作者: wxfy2011    时间: 2013-12-13 11:10
站长苏飞 发表于 2013-12-13 10:46
@wxfy2011 @xiaomazhu 看看Header里有没有,不可能没有的

Allowautoredirect = true 设为true就是返回到登陆界面,false就是“本次请求未返回任何数据”


作者: 站长苏飞    时间: 2013-12-13 11:49
wxfy2011 发表于 2013-12-13 11:10
Allowautoredirect = true 设为true就是返回到登陆界面,false就是“本次请求未返回任何数据”

那可能是在Header里你看看有没有

作者: 23360598    时间: 2015-7-2 18:25
看看是否有httponly




欢迎光临 苏飞论坛 (http://www.sufeinet.com/) Powered by Discuz! X3.4