title: Java webview: "Failed to read the 'cookie' property from 'Document': Access is denied for this document"
body: <p>I'm trying to use a cookie in my webview without success.</p>
  
  <p>In my code: </p>
  
  <pre><code>CookieManager cookieManager = CookieManager.getInstance();
      cookieManager.setAcceptFileSchemeCookies(true);
      cookieManager.setAcceptCookie(true);
      cookieManager.acceptCookie();
  
      myWebView = (WebView) getView(champHTML);// description du champ HTML WM16
      myWebView.setBackgroundColor(Color.parseColor("#42A334"));
      myWebView.getSettings().setJavaScriptEnabled(true); //autorisation javascript
  </code></pre>
  
  <p>But when I want to debug my webview with Chrome Dev Tools, I get:</p>
  
  <blockquote>
    <p>Uncaught SecurityError: Failed to read the 'cookie' property from
    'Document': Access is denied for this document.</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>
  
  <p>Edit:
  I forgot to specify that i display in my webview an offline page HTML.</p>
  
  <p>And i don't understand, when i'm in console tab in Chrome Developper Tools, I can read the error message :
  SecurityError: Failed to read the 'cookie' property from 'Document': Access is denied for this document.</p>
  
  <p>If I change the url width "window.location = '<a href="http://www.google.fr">http://www.google.fr</a>', the page is displayed on my webview and if i type in the tab console 'window.cookie'. I haven't any error, i can see the cookie value.</p>
  
  <p>But if I use 'history.back()', the webview display my offlinepage, and if type : 'window.cookie', I get always the same error.</p>
  
  <p>The error message is displayed when i use an offline page.</p>
  
  <p>May be sombody have an idea ?</p>