I've created a login on my website using forms authentication, I do not understand why after creating the ticket and adding it to the cookies
if I check for HttpContext.Current.Request.IsAuthenticated
i get false. Only on the successive request the user become authenticated
this is my code
var fat = new FormsAuthenticationTicket(
1,
username,
DateTime.Now,
DateTime.Now.AddMinutes(20),
rememberMe,
contact.Id + "," + contact.Role.Id,
FormsAuthentication.FormsCookiePath);
HttpContext.Current.Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(fat)));
at this point if I check for HttpContext.Current.Request.IsAuthenticated i get false, i thought a this point the user is authenticated...
this is my config
<authentication mode="Forms">
<forms loginUrl="/Admin/Login.aspx" name="FormAuthentication" />
</authentication>
<authorization>
<deny users="?"/>
</authorization>
thanks.