MVC4ユーザー認証に問題があります。
System.Web.Security.Membership.ValidateUserを返しますtrue。
次にFormsAuthentication.SetAuthCookie、に到達し、ブラウザにCookieが表示されます。
その後、User.Identity.IsAuthenticatedまだfalse何らかの理由で評価します。
User.Identity.IsAuthenticatedリダイレクト後もfalseであり、そのままfalseです。
[AllowAnonymous]
[HttpPost]
public ActionResult Login(LoginModel model, string returnUrl)
{
if (ModelState.IsValid)
{
if (System.Web.Security.Membership.ValidateUser(model.UserName, model.Password))
{
FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
if (Url.IsLocalUrl(returnUrl))
{
return Redirect(returnUrl);
}
else
{
return RedirectToAction("Index", "Home");
}
}
else
{
ModelState.AddModelError("", "The user name or password provided is incorrect.");
}
}
// If we got this far, something failed, redisplay form
return View(model);
}