1

我今天安装了IE9,并且我的FormsAuthentication已停止工作。 我的步骤 - 在Visual Studio 2010中创建ASP.NET MVC2应用程序,向HomeController添加Authorize属性,打开AccontController和注释行44,56,58。点击F5输入用户并点击ENTER,IE9不会向HomeController发送身份验证CookieIE9 FormsAuthentication

[HandleError, Authorize] 
    public class HomeController : Controller 
    { 
     public ActionResult Index() 
     { 
      ViewData["Message"] = "Welcome to ASP.NET MVC!"; 

      return View(); 
     } 
    } 

    [HttpPost] 
    public ActionResult LogOn(LogOnModel model, string returnUrl) 
    { 
    if (ModelState.IsValid) 
    { 
      //if (MembershipService.ValidateUser(model.UserName, model.Password)) 
      { 
       FormsService.SignIn(model.UserName, model.RememberMe); 
       if (!String.IsNullOrEmpty(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); 
    } 
+0

您有重现此问题的网址吗? – EricLaw 2011-03-18 00:56:29

回答

0

无法重现。对我来说工作得很好。你的设置一定有其他问题。你确认cookies是否启用了吗?

+0

好的,谢谢,默认情况下IE9设置已禁用了Cookie :)。我如何能够关闭这个问题? – Xnko 2011-03-18 09:18:57

+0

完成,谢谢:) – Xnko 2011-03-18 09:22:03