【发布时间】:2014-12-18 02:28:40
【问题描述】:
我在 cookie 中存储了一些 UserData。它在 chrome 和 mozilla 中运行良好。但在 IE 中无法获取 cookie。我使用的是 IE 版本 10。请帮帮我?
在登录表单中:
Dim Mydtt As String = "my custom data "
Dim authTicket = New FormsAuthenticationTicket(2, usrid, Date.Now, Date.Now.AddDays(7), True, Mydtt, "/")
Dim cookie As New HttpCookie("usrlg", FormsAuthentication.Encrypt(authTicket))
Response.Cookies.Set(cookie)
Response.Redirect("~/phed/reports")
在会话开始时:
Dim LastLoginCookie As HttpCookie
LastLoginCookie = HttpContext.Current.Request.Cookies.Get("usrlg") ' Return Nothing in IE '
Dim LastLgTicket As FormsAuthenticationTicket = FormsAuthentication.Decrypt(LastLoginCookie.Value)
Dim Mydtt As String = LastLgTicket.UserData
【问题讨论】:
标签: asp.net asp.net-mvc internet-explorer cookies