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