Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear WebBrowser cache in WPF application?

Tags:

c#

caching

wpf

I am using the WebBrowser control to display a Login page for user to signing to their account and then application will get contacts from that account.

However, the problem is if user select option "Keep signing" from browser, browser will cache that account name and next login with different account, it will return previous cached account name. This lead to application will get wrong account name.

You guys know how to force WebBrowser to clear all cache before proceed to prevent this problem?

I think WebBrowser use Internet Explorer, which is version 11 on my machine.

like image 812
Thong Vo Avatar asked Jun 14 '16 08:06

Thong Vo


1 Answers

I solved my problem by follow this link: http://mdb-blog.blogspot.com/2013/02/c-winforms-webbrowser-clear-all-cookies.html

like image 130
Thong Vo Avatar answered Nov 20 '22 02:11

Thong Vo