How to save information of authorized logon user

69 Views Asked by At

Im using ASP.NET web application and FormsAuthenticationTicket. In the FormsAuthenticationTicket i save the userName but i need the ID of the user too. I have tried to save the ID in Session but its not always works.

FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, t.FullName,      DateTime.Now,
                DateTime.Now.AddMinutes(2880), CheckBox1.Checked, t.Credential, FormsAuthentication.FormsCookiePath);
            string hash = FormsAuthentication.Encrypt(ticket);
            HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, hash);

is there a way to save the ID too in better way?

0

There are 0 best solutions below