T
tshad
I can add a cookie fine, but I can't seem to figure out how to change the
value of a cookie and save it back.
My code looks like:
if (passwordSaveCookie.checked) then
If Request.Cookies("User") is nothing Then
Dim cookie As New HttpCookie("User")
cookie.Values.Add("UserName",UserName.Text)
cookie.Values.Add("UserFirstName",dbReader("FirstName"))
cookie.Values.Add("UserLastName",dbReader("LastName"))
cookie.Expires = DateTime.MaxValue
Response.AppendCookie(cookie)
else
Dim cookie As HTTPCookie = Request.Cookies("User")
cookie.Values("UserName") = UserName.Text
cookie.Values("UserFirstName") = dbReader("FirstName")
cookie.Values("UserLastName") = dbReader("LastName")
End If
end if
I don't get any errors, but when I close my browser and start it back up
again, the old values are now back.
If you create the cookie, you use "Response.AppendCookie".
Is there a corresponding call for updating a current cookie?
Thanks,
Tom
value of a cookie and save it back.
My code looks like:
if (passwordSaveCookie.checked) then
If Request.Cookies("User") is nothing Then
Dim cookie As New HttpCookie("User")
cookie.Values.Add("UserName",UserName.Text)
cookie.Values.Add("UserFirstName",dbReader("FirstName"))
cookie.Values.Add("UserLastName",dbReader("LastName"))
cookie.Expires = DateTime.MaxValue
Response.AppendCookie(cookie)
else
Dim cookie As HTTPCookie = Request.Cookies("User")
cookie.Values("UserName") = UserName.Text
cookie.Values("UserFirstName") = dbReader("FirstName")
cookie.Values("UserLastName") = dbReader("LastName")
End If
end if
I don't get any errors, but when I close my browser and start it back up
again, the old values are now back.
If you create the cookie, you use "Response.AppendCookie".
Is there a corresponding call for updating a current cookie?
Thanks,
Tom