Author: irani | Posted on: 1/23/2005 1:27:11 AM | Views : 700

i write this coe when user logged in my site for authenticate it :





Dim tkt As FormsAuthenticationTicket


Dim ck As HttpCookie


Dim StrCk As String





Try


tkt = New FormsAuthenticationTicket(1, UserName, DateTime.Now, DateTime.Now.MaxValue, Persistent, UserData)


StrCk = FormsAuthentication.Encrypt(tkt)


ck = New HttpCookie(FormsAuthentication.FormsCookieName, StrCk)


If Persistent Then ck.Expires = tkt.Expiration


ck.Path = FormsAuthentication.FormsCookiePath


HttpContext.Current.Response.Cookies.Add(ck)


Catch pag As Exception


HttpContext.Current.Response.Write(pag.Message)


End Try








when persistent is true, this cookie is permanent but even if i sign out , when i see my site next time, i authenticate as a user that log ...

Go to the complete details ...