title: Cefsharp clearing cache,cookies and browser data in wpf
body: <p>I am developing an app on a banking device that uses cefsharp browser as a part of it. Cause this app will be used by anyone it should not save any data from previous user that the next user can see. I want to clear all cached browser data after closing it.</p>
  
  <pre><code>public void InitBrowser()
      {
          settings = new CefSettings();
          settings.CachePath = AppDomain.CurrentDomain.BaseDirectory + "cache";
          settings.CefCommandLineArgs.Add("disable-application-cache", "1");
          settings.CefCommandLineArgs.Add("disable-session-storage", "1");
          if (!Cef.IsInitialized) Cef.Initialize(settings);
          webBrowser = new CefSharp.Wpf.ChromiumWebBrowser();
          MainGrid.Children.Add(webBrowser);
      }
  </code></pre>
  
  <p>I want to clear all cached data after a function named  <code>WebPages_Exit</code> is called. How can I remove all cached data without removing the browser instance or shutting down the CEF cause CEF can't be initialized twice and creating another instance of browser after disposing it is not working.</p>
  
  <p>I implemented <code>visit</code> function in <code>ICookieVisitor</code> to save cookies as well and used methods like <code>deleteCookies</code> or disabling cache cefSetting command, but nothing works cause cookies list is empty and <code>visit</code> function of <code>IcookieVisitor</code> is never called. it seems that it is saved in another part and just resets when CEF will shutdown.</p>