Jak usunąć plik cookie z .Net [duplikat]

Możliwy duplikat:
Usuń plik cookie po kliknięciu wyloguj się

Chcę usunąć pliki cookie po wylogowaniu użytkownika.

Oto mój kod:

 if (HttpContext.Current.Request.Cookies["currentUser"] != null)
 {
     DeleteCookie(HttpContext.Current.Request.Cookies["currentUser"]);
 }


       public void DeleteCookie(HttpCookie httpCookie)
        {
            try
            {
                httpCookie.Value = null;
                httpCookie.Expires = DateTime.Now.AddMinutes(-20);
                HttpContext.Current.Request.Cookies.Add(httpCookie);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }

Ale to nie działa. Masz jakieś propozycje?

questionAnswers(4)

yourAnswerToTheQuestion