title: How to clear/disable browsing history for UIWebView
body: <p>I am building an iPad app to be used in a public multi-user scenario and want to allow temporary web browsing sessions. However, when the session is finished, I want the app to clear all private browsing data including cache, cookies and history.</p>
  
  <p>I have figured out how to clear the cache and the cookies, but the history is eluding me.</p>
  
  <p>Just to be clear, I'm not looking to clear the back/forward history of the <code>UIWebView</code> (I am creating a new instance of <code>UIWebView</code> each time so that isn't an issue). I am looking to clear the entire application's browsing history, so that links do not appear visited.</p>
  
  <p>For example, if I search for something on Google and visit one of the hits, the link turns purple the next time I Google it. I want all history and past web pages to be erased so that no links stay purple after the browsing session is reset.</p>
  
  <p>Alternatively, if I could just entirely disable history tracking (like a "private browsing mode" à la Chrome or Firefox) that would also be acceptable.</p>
  
  <p><strong>Update:</strong> Interestingly, I noticed that quitting and restarting the app implicitly clears the browsing history, and links once again appear blue upon startup. <em>However</em>, this unfortunately doesn't help me at all because the app is designed and intended to be run for long periods of time across many users. We can't quit the app after each session.</p>
  
  <p><strong>Update 2:</strong> Further experimentation shows that the web history is definitely maintained on a per-application basis. I googled the same thing in Safari and the links that show purple each time in my app appear blue in Safari. There has to be a way to access this local storage from within the app.</p>