title: ASP.NET MVC Logout with Form Authentication
body: <p>I have a <code>Logout action</code> on a controller as so:</p>
  
  <pre><code>public ActionResult Logout()
  {
      FormsAuthentication.SignOut();
      Session["UserCredential"] = null;
      return RedirectToAction("Index", "Home");
  }
  </code></pre>
  
  <p>This working in google chrome browser. but when I am using my web application with firefox browser (latest version) after login and logout from first time. and when I am doing login again to application and pressing on logout button, I am not able to logout from web application. <code>Request.IsAuthenticated</code> is returning me true value.</p>
  
  <p><b>For Login I used following action:</b></p>
  
  <pre><code>        [HttpPost]
          public JsonResult Login(string userName, string password)
          {
  
              User oUser = oRepository.GetUser(userName,password); 
              Session["UserCredential"] = oUser;
  
  
              if (oUser != null)
              {
                  if (oUser.IsVerified)
                  {
                      string url = Request.Url.AbsolutePath;    
                      FormsAuthentication.SetAuthCookie(userName, false);
                      return Json(new { res = 1, RedirectUrl = Url.Action("Index", "Home") }, JsonRequestBehavior.AllowGet);
                  }
                  else
                  {
                      return Json(new { res = 0, RedirectUrl = "" }, JsonRequestBehavior.AllowGet);
                  }
              }
  
              return Json(new { res = -1, RedirectUrl = "" }, JsonRequestBehavior.AllowGet);
          }
  </code></pre>
  
  <p>Anyone have idea what i have to do to solve my problem with firefox browser.</p>