T
tshad
I am trying to write out and update my cookies, but it doesn't seem to work
correctly. I am using the following code:
if (passwordSaveCookie.checked) then
If Request.Cookies("User") is nothing Then
Dim cookie As New HttpCookie("User")
cookie.Values.Add("UN",UN.Text)
cookie.Values.Add("UFN",dbReader("FN"))
cookie.Values.Add("ULN",dbReader("LN"))
cookie.Expires = DateTime.MaxValue
Response.AppendCookie(cookie)
else
response.Cookies("User")("UN") = UN.Text
response.Cookies("User")("UFN") = dbReader("FN")
response.Cookies("User")("ULN") = dbReader("LN")
End If
end if
What seems to be happening is that if you already have a cookie and you say
to save the cookie, it ties to save the cookie and shows the new cookie in
the Cookie manager in Mozilla. So it seems to work.
But if you close the Browser and look, it isn't there.
If you now try to save it, it will work.
So it takes two times to make the change. The first time it will delete the
cookie (even though it shows the new cookie there) and then when you try the
next time (after the cookie is gone), it works fine.
What am I missing here?
Thanks,
Tom
correctly. I am using the following code:
if (passwordSaveCookie.checked) then
If Request.Cookies("User") is nothing Then
Dim cookie As New HttpCookie("User")
cookie.Values.Add("UN",UN.Text)
cookie.Values.Add("UFN",dbReader("FN"))
cookie.Values.Add("ULN",dbReader("LN"))
cookie.Expires = DateTime.MaxValue
Response.AppendCookie(cookie)
else
response.Cookies("User")("UN") = UN.Text
response.Cookies("User")("UFN") = dbReader("FN")
response.Cookies("User")("ULN") = dbReader("LN")
End If
end if
What seems to be happening is that if you already have a cookie and you say
to save the cookie, it ties to save the cookie and shows the new cookie in
the Cookie manager in Mozilla. So it seems to work.
But if you close the Browser and look, it isn't there.
If you now try to save it, it will work.
So it takes two times to make the change. The first time it will delete the
cookie (even though it shows the new cookie there) and then when you try the
next time (after the cookie is gone), it works fine.
What am I missing here?
Thanks,
Tom