title: how to remove cookies from browser in asp.net c#, SO answers NOT working
body: <p>I'm trying to remove cookies using C# when a user logs out. The code suggestions listed here: <a href="https://stackoverflow.com/questions/2816452/remove-cookies-from-browser">remove cookies from browser</a> do not work. I put several of them together in desperation and they are not working.</p>
  
  <pre><code>if (Request.Cookies["loginidcookie"] != null)
  {
      HttpCookie myCookie = new HttpCookie("loginidcookie");
      myCookie.Value = String.Empty;
      myCookie.Expires = DateTime.Now.AddDays(-1d);
      Response.Cookies.Add(myCookie);
      Response.Cookies.Remove("loginidcookie");
  }
  Response.Redirect("logout.aspx");
  </code></pre>
  
  <p>So not only am I overwriting the value of the cookie with an empty string, I am setting it to expire yesterday AND removing it from the list of cookies. Yet when I run this code then hit the back button and reload, the cookie is still there with its original value. So how do I get rid of it?</p>
  
  <p>Thank you</p>