I have a pop up form in that form I load my Login view using jquery UI dialog .When the Login button is clicked I invoke the Account/Login action using ajax post .Here is my code :
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<ActionResult> Login(LoginViewModel model)
{
if (ModelState.IsValid)
{
var user = await UserManager.FindAsync(model.UserName, model.Password);
if (user != null)
{
await SignInAsync(user, model.RememberMe);
//IsAuthenticated is returns false
bool isAuthenticated= User.Identity.IsAuthenticated;
return PartialView("_LoginPartial");
}
else
{
ModelState.AddModelError("", "Invalid username or password.");
}
}
// If we got this far, something failed, redisplay form
return View(model);
}
after the SignInAsync method is invoked ,the User.Identity.IsAuthenticated is returns false why thats happening?
Would appreciate any help offered. Let me know if you need any other information to help answer this question