Esempio n. 1
0
        private void Disconnect()
        {
            FormsAuthentication.SignOut();
            _accountService.Logout();
            CacheService.CleanAllCache();

            List <HttpCookie> cookies = new List <HttpCookie>();

            foreach (var cookie in Request.Cookies)
            {
                HttpCookie c = new HttpCookie(cookie.ToString());
                c.Expires = DateTime.Now.AddDays(-1);
                cookies.Add(c);
            }

            foreach (var cookie in cookies)
            {
                Response.Cookies.Add(cookie);
            }
        }