public ActionResult Index2() { var cookie = Request.Cookies[WebContent.UserCookie]; if (cookie != null) { string result = RoleHelper.CheckLogined(cookie.Value); if (result != "error") { if (HttpContext.Session[WebContent.UserSession] == null) { return(View()); } else { return(RedirectToAction("Index", "Home")); } } else { HttpContext.Response.Cookies[WebContent.UserCookie].Expires = DateTime.Now.AddDays(-1);//清除本地cookie return(View()); } } else { return(View()); } }