无法在asp.net中读取cookie

时间:2018-05-24 14:50:03

标签: c# asp.net

我的asp.net web表单中有一个代码page_load

 if(HttpContext.Current.Request.Cookies["timezoneoffset"] != null)
 {
     HttpContext.Current.Session["timezoneoffset"] = HttpContext.Current.Request.Cookies["timezoneoffset"].Value;
 }
 else
 {
     HttpContext.Current.Session["timezoneoffset"] = 0;
 }

当我调试控件流过if块时。但是当我部署时,它将转向其他方面。有人可以帮助我阅读这个cookie并将其设置为会话吗?

0 个答案:

没有答案