So one of my co-workers used the following code to "remove" the cookies from the browser. This should work, but checking the cookies right after loading the page the cookies are still there. Is there something wrong with this code or is there a bigger problem?
protected void Page_Load(object sender, EventArgs e)
{
HttpCookie aCookie;
string cookieName;
int limit = Request.Cookies.Count;
for (int i = 0; i < limit; i++)
{
cookieName = Request.Cookies[i].Name;
aCookie = new HttpCookie(cookieName);
aCookie.Expires = DateTime.Now.AddDays(-1);
if (cookieName != "Lang")
Response.Cookies.Add(aCookie);
}
FormsAuthentication.SignOut();
Response.Redirect("/default.aspx");
}