title: Can't delete cookie in ASP.NET C#
body: <p>I've got a logout.aspx that is called when the user clicks logout and there is where I want to delete the cookies but it just won't do it...</p>
  
  <pre><code>public partial class LogoutUser : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          HttpCookie cookie;
  
          cookie = Request.Cookies.Get("Basket");
          if (cookie == null)
          {
              cookie = new HttpCookie("Basket");
          }
  
          foreach (string item in cookie.Values.AllKeys)
          {
              Response.Cookies[item].Expires = DateTime.Now.AddDays(-1);                
          }
  
          cookie.Expires = DateTime.Now.AddDays(-1d);
          Response.Cookies["Basket"].Expires = DateTime.Now.AddYears(-1);    
          Session.Abandon();   
  
          Response.Redirect("~/Default.aspx");
      }
  }
  </code></pre>
  
  <p>The cookie stores the values in the basket but after logging out I can still access the basket I don't know what's wrong. </p>