Link to home
Start Free TrialLog in
Avatar of davidcahan
davidcahanFlag for United States of America

asked on

Login and FormsAuthentication

Can someone explain to me in very lay terms what each line of this code is actually doing (including all the comma-seperated variables).  I'm using it in my login and it works, but I'd actually like to know what is going on.

FormsAuthentication.Initialize()
                                       Dim isPersistent As Boolean = True
                    Dim ticket As FormsAuthenticationTicket = New FormsAuthenticationTicket(1, strUserName.Text, DateTime.Now, DateTime.Now.AddHours(1), isPersistent, strUserName.Text, FormsAuthentication.FormsCookiePath)
                    Dim hash As String = FormsAuthentication.Encrypt(ticket)
                    Dim cookie As HttpCookie = New HttpCookie(FormsAuthentication.FormsCookieName, hash)
                    FormsAuthentication.RedirectFromLoginPage("default.aspx", False)

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial