Can you tell me why FormsAuthentication.SetAuthCookie(user.Name, false);
is not causing Request.IsAuthenticated
to be true?
Here is my code
I had exactly same problem in my MVC4 Web Application
. One more possible reason for this problem is below method in IdentityModels.cs
file
public async Task GenerateUserIdentityAsync(UserManager manager)
{
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
// Add custom user claims here
return userIdentity;
}
Make sure DefaultAuthenticationTypes
is ApplicationCookie
Cheers,