今天客户投诉,博客在遨游3不能登录了。于是,便一层层查找,终于发现 HttpContext.Current.Request.Browser.Cookies(判断客户端浏览器是否支持COOKIE) 在遨游3下总是返回为False,因此导致无法读取客户的COOKIE。

 

在此告诫一下,以后避免类似浏览器问题,不要再使用 HttpContext.Current.Request.Browser.Cookies 进行判断,直接 HttpContext.Current.Request.Cookies[Key] != null 就可以了。

 

----------2011.11.11更新-------------

更详细的解释,请看@dudu的文章

ASP.NET4中不要相信Request.Browser.Cookies,Form验证要用UseCookies

http://www.cnblogs.com/dudu/archive/2011/03/06/asp_net_4_browser_cookie.html

posted on 2011-08-29 16:56  w3live  阅读(2102)  评论(21编辑  收藏  举报