Ejemplo n.º 1
0
        public ActionResult Logout(ConfirmationViewModel confirmViewModel)
        {
            FormsAuthentication.SignOut();

            Response.Cookies.Remove(FormsAuthentication.FormsCookieName);
            Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
            HttpCookie cookie = HttpContext.Request.Cookies[FormsAuthentication.FormsCookieName];
            if (cookie != null)
            {
                cookie.Expires = DateTime.Now.AddDays(-1);
                Response.Cookies.Add(cookie);
            }

            UserContextThreadLocal.Value = null;

            return RedirectToAction("Login");
        }
Ejemplo n.º 2
0
        public ActionResult Logout()
        {
            ConfirmationViewModel confirmViewModel = new ConfirmationViewModel
            {
                DetailText = LangResource.Resources.LogoutConfirm,
                HeaderText = "Logout",
                PostController = "Account",
                PostAction = "Logout"
            };

            return PartialView("_ConfirmationDialog", confirmViewModel);
        }