Пример #1
0
        public ActionResult PartialLogOff()
        {
            FormsAuthentication.SignOut();

            this.HttpContext.Cache.Remove(User.Identity.Name);

            ContextExtensions.RemoveCachedUserData();

            return(PartialView("_Empty"));
        }
Пример #2
0
        //
        // GET: /Account/LogOff
        public ActionResult LogOff()
        {
            using (AuditLogService aservice = new AuditLogService())
            {
                aservice.Create(ActivityTypes.Logout, CurrentUser, null, CurrentUser?.Id ?? 0);
            }

            FormsAuthentication.SignOut();

            this.HttpContext.Cache.Remove(User.Identity.Name);

            ContextExtensions.RemoveCachedUserData();

            return(RedirectToAction("Login"));
        }