示例#1
0
        public ActionResult LogOff()
        {
            //WebSecurity.Logout();
            //return RedirectToAction("Index", "Home");
            var userContext = _workContext.GetAuthenticatedUser();

            _memoryCache.DeleteCache(userContext.User.UserName);
            FormsAuthentication.SignOut();
            Session.Abandon();

            return(RedirectToAction("Index", "Home"));
        }
示例#2
0
        public void Update(User user)
        {
            if (user == null)
            {
                throw new ArgumentNullException("user");
            }

            _userRepository.Update(user);

            _memoryCache.DeleteCache(user.UserName);
            _memoryCache.DeleteCache("UserContext" + user.UserName);
        }