How to Clear WebBrowser control 'Cache'?
-
I have created a program to enter sites and preview them in the WebBrowser control. The problem is that sometimes when I login to a site, for example it says: "Welcome Trapper" and afterwards if I intend to login to the site with a different user, it would not allow this, by still saying "Welcome Trapper". The website has no logout feature, and is probably intended to preserve the user after being logged in. If you close the program and open it up again, the site would require a username and password (which is what I need) but it is not efficient to have to close and open your program every time a login is to be made. I have already implemented the code below: HttpRequestCachePolicy policy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore); HttpWebRequest.DefaultCachePolicy = policy; but I need to find something which will totally remove any tracks of the user so the site will ask for my login creditentials every single time... Any help?
-
I have created a program to enter sites and preview them in the WebBrowser control. The problem is that sometimes when I login to a site, for example it says: "Welcome Trapper" and afterwards if I intend to login to the site with a different user, it would not allow this, by still saying "Welcome Trapper". The website has no logout feature, and is probably intended to preserve the user after being logged in. If you close the program and open it up again, the site would require a username and password (which is what I need) but it is not efficient to have to close and open your program every time a login is to be made. I have already implemented the code below: HttpRequestCachePolicy policy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore); HttpWebRequest.DefaultCachePolicy = policy; but I need to find something which will totally remove any tracks of the user so the site will ask for my login creditentials every single time... Any help?
-
If the site uses cookies, that might be causing the auto login. Depending on how many sites your app works with, you could try simply deleting the cookie each time before you load up the site.