From a C# page, I can't delete a cookie on Firefox and Internet Explorer. I use the Expires changing method with works perfectely from on a Chrome browser...
I founs many way to delete cookies on the Internet, and in a last chance try, I execute them like this :
protected void Page_Load(object sender, EventArgs e)
{
try
{
Response.Cookies["CDV_Id_User"].Value = "-1";
}
catch
{
}
try
{
Request.Cookies["CDV_Id_User"].Value = "-1";
}
catch
{
}
try
{
Response.Cookies["CDV_Id_User"].Expires = DateTime.Now.AddDays(-1);
}
catch
{
}
try
{
Request.Cookies["CDV_Id_User"].Expires = DateTime.Now.AddDays(-1);
}
catch
{
}
try
{
HttpContext.Current.Session.Abandon();
}
catch { }
try
{
HttpContext.Current.Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", ""));
}
catch { }
Session["id_user"] = null;
Response.Redirect("~/Default.aspx", false);
}
But even with execution of such many way to make the cookie CDV_Id_User expire, this NEVER works on Firefox... but only on Chrome...
HELP please ! :-)