[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.mobile

remember me cookies in asp.net

James

1/7/2006 12:17:00 PM

hi,
I'm trying to remember a user who has visited the page. what i found out was
to use persistent cookie, is there any other way that i can remember the
user next time he visit?

When using cookies, I used the code below to add
-----in login.aspx------
Dim aCookie As New HttpCookie("userInfo")
aCookie.Values("userID") = "1"
aCookie.Expires = DateTime.Now.AddYears(50)
Response.Cookies.Add(aCookie)

and to retrieve, I used
-----in default.aspx------
Server.HtmlEncode(Request.Cookies("userInfo")("userId"))

but I wasn't able to retrieve values from the cookies. does it matter where
I create the cookies, as i check for the cookie in default.aspx and redirect
to login.aspx if the cookie is not found.

Hope someone can help!

Thank You!!!