【发布时间】:2023-04-01 01:43:01
【问题描述】:
我正在使用 ASP.NET 和 VB.NET 2.0....................... .
这是我创建 Cookie 时使用的代码
If dlgLogin.RememberMeSet = True Then
Dim RateCookie As New HttpCookie("LoginInfo")
RateCookie.Values("Email") = dlgLogin.UserName
RateCookie.Values("Password") = dlgLogin.Password
RateCookie.Expires = DateTime.Now.AddDays(100)
Response.Cookies.Add(RateCookie)
End If
这是我在页面加载事件中用来读取 Cookie 但我无法读取的代码?
If Not Request.Cookies("Email") Is Nothing Then
Dim RateCookie As HttpCookie = Request.Cookies("Email")
Session("myEmailSession") = Server.HtmlEncode(RateCookie.Value)
End If
我做错了什么????
【问题讨论】:
-
有什么问题?什么不工作,你得到什么错误。问题中的“有问题”并不是很多事情要继续
-
我不确定它是否真的在我创建它时保存了我的 cookie....因为我似乎无法读取 Cookie..........