0

Is it possible to delete all the cookies from windows form web browser, if yes can anyone tell how? Like where it stores the cookies so that i can delete that folder?

  • See: https://stackoverflow.com/questions/912741/how-to-delete-cookies-from-windows-form – VDWWD Aug 16 '18 at 10:08

2 Answers2

0

The Browser does manage the cookies. In theory deleting the cookies is possible by locating the file, which holds the cookies and deleting the file or its content. But the location and type (could be a simple textfile or a database) of this file is different for each browser and can differ by version too. So there is no generic way to do this.

A trick to remove individual cookies indirectly is to set the expiring date to the past and refreshing the page:

if (Request.Cookies["CookieToDelete"] != null)
{
   Response.Cookies["CookieToDelete"].Expires = DateTime.Now.AddDays(-1);
   Response.Redirect("SomePage.aspx");
   ...
}
S. Stumm
  • 290
  • 1
  • 9
  • I am not using any server, so i dont have any HttpRequest Object. Its just storing previous things in cookies and i just want them not be created again and again – Akshay SIngh Aug 16 '18 at 10:57
0

Open Run type Shell:Cookies and enter folder open with all cookies.

List of Cookies

Remove specific cookies by providing name

if (Request.Cookies["xyz"] != null) { Response.Cookies["xyz"].Expires = DateTime.Now.AddDays(-1); }