Пример #1
0
        /// <summary>
        ///清除session
        /// </summary>
        /// <returns></returns>
        public static bool Destroy()
        {
            HttpCookie cookie = HttpContext.Current.Request.Cookies[CookieName];

            if (cookie != null)
            {
                cookie.Expires = DateTime.Now.AddDays(-1);
                HttpContext.Current.Response.Cookies.Set(cookie);
                using (var service = new RedisHashService())
                {
                    service.Remove(RedisKey);
                }
            }
            return(false);
        }