c# Webbrowser Can't delete Cookies/Cache

fluxo27

Junior Member
Joined
Apr 27, 2013
Messages
195
Reaction score
31
Hello,

before I reinstalled the the system on my computer, when I used CCleaner oder Manually deleted the Cookies from my Internet Explorer,
the cookies from the webbrowser in my c# application were deleted too. My Application was also using an Adblock.

But now, the c# webbrowser keeps its cookies and cache and also doesn't use adblock, can anyone tell me how to fix this? :(
 
Your web browser in C# is inherited from Windows Internet Explorer, therefore any changes made to IE will affect your browser as well. :)
 
You should use IE api for this you can call api from your c# application and you will be able to clear your cookies and cache
 
Use selenium if you're really into emulating browsers.
 
Use GeckoFx + Xulrunner and you won't regret this choice.
Firefox uses this engine and I'm sure you know how good firefox is.

Latest is version 29 (Just for your info)
 
You can delete cookies in C# by setting their expiration date to 1 day before.

Example:
var cookie = new HttpCookie(name) {Expires = DateTime.Now.AddDays(-1d)};
response.Cookies.Add(cookie);
 
You can update IE to latest version 11.0(or far) and then use some RegKey function in your application to make navigations as IE11 and not as IE7. If you need some help with it PM me your skype,email or something and i will gladly help you.
Thanks
 
Back
Top