asp.net接收cookies以及session丢失问题
响应头信息
Cache-Controlprivate
Connectionkeep-alive
Content-Length631
Content-Typetext/plain; charset=utf-8
DateMon, 30 Apr 2012 03:12:33 GMT
ServerMicrosoft-IIS/6.0
Via1.0 test.abc.com.324647dhf (squid/3.0.STABLE20)
X-AspNet-Version4.0.30319
X-CacheMISS from test.abc.com.324647dhf
X-Cache-LookupMISS from test.abc.com.324647dhf:80
X-Powered-ByASP.NET
请求头信息
Accepttext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encodinggzip, deflate
Accept-Languagezh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3
Connectionkeep-alive
Content-Length32
Content-Typeapplication/x-www-form-urlencoded; charset=UTF-8
CookieHm_lvt_bbfa2502bd863a3307bcff3d0c2d1a43=1333021001370; Hm_lvt_bd78d8b2335659b176c255236801d891=1330388869599; Hm_lvt_198231243c943163942405d7ed43cafa=1331371579334; Hm_lvt_bbfa2502bd863a3307bcff3d0c2d1a43=1331810376786; Hx2V_2132_ulastactivity=837aSal0ep5tfJ32NTk9MKpEjXdZ%2BKLlFvT5sSi9TzE3wvhUiDG0; Hx2V_2132_smile=3D1; rtime=20; ltime=1335755460779; cnzz_eid=31291927-1331438717-; UserID=1; 72501Comment=; 6467Comment=; ASPSESSIONIDSQABBTQD=HADLAPPCNCDFCAPPILMDAOEJ; ASP.NET_SessionId=qqxp3wux12iane3w1j0z2h3g; cnzz_a3433468=4; sin3433468=; ASPSESSIONIDQSACCQQC=LKHBMPPCBNPGPHIKEABNMKLK
Hostwww.ixinchen.com
Refererhttp://www.ixinchen.com/bbs/admin
User-AgentMozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0
X-Requested-WithXMLHttpRequest
上面是ff中给出的信息
context.Request.Cookies["UserID"]
这个是在cs文件中接收cookies用的
登录之后,不知道会在什么时候,session会丢失,这个我就忍了
关键是,session丢失之后,cookies也接收不到了,session未丢失时就能接收到
但从ff里面看cookies明明是发送出去的
web.config中是这样写的
<sessionState mode="StateServer"></sessionState>
[解决办法]
如果是做登录认证欢迎参看》http://blog.csdn.net/rayyu1989/article/details/7522332
[解决办法]
ASP.NET_SessionId 才是session的Key!它变了,Session自然就变了。
[解决办法]
当然,即使它不变,Session也会丢失。
不过ASP.NET_SessionId改变了,Session肯定就是不一样的。