Last post Aug 07, 2014 07:19 AM by Michelle Ge - MSFT
Aug 04, 2014 03:13 AM|ramasuperstar|LINK
in forms authentication i'm securing a cookie while logging in, but the form does n't get authenticated after entering the user credentials
i'm securing the cookie at global.ascx.cs
Please help me out on this
Aug 04, 2014 09:35 AM|BrockAllen|LINK
There's much much info to go on here. I'd suggest debugging some more and posting a better description of what's happening (or not happening).
Aug 07, 2014 07:19 AM|Michelle Ge - MSFT|LINK
According to your description, your cookie is null, so you need to check that you have saved value to it, please refer to the code below to add value to cookie:
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(userInfo.Username, false, 5);
string encryptedTicket = FormsAuthentication.Encrypt(ticket);
HttpCookie authCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket);
Hope it's useful for you.