title: Session.cookies is empty while JavaScript document.cookie is not
body: <p>I want to get all the cookies from a BrowserWindow object, including HTTPonly cookies.
  I've read through the documentation that the following code will output all the cookies being used in the BrowserWindow:
  <code>windowObject.webContents.session.cookies</code>.
  This returns an empty cookies object: <code>Cookies: {}</code>.</p>
  
  <p>If I use the following code, I do get all the cookies except for the much needed HTTPonly (which are not returned due to security purposes):</p>
  
  <pre><code>return windowObject.webContents.executeJavaScript(`document.cookie;`,true).then(function(result){
   console.log(result);
  });
  </code></pre>
  
  <p><strong>Proof of the issue;</strong>
  <em>Place this code inside your app.on('ready') function:</em></p>
  
  <pre><code>const Window = electron.BrowserWindow;
  var windowObject = new Window({show: true, webPreferences:{images:false}});
  windowObject.loadURL("https://www.tweakers.net");
  windowObject.webContents.on('did-finish-load', function() {
    console.log(windowObject.webContents.session);
    console.log(windowObject.webContents.session.cookies);
    windowObject.webContents.executeJavaScript(`document.cookie;`, true).then(function(result){
      console.log(result);
    });
  });
  </code></pre>
  
  <p><strong>Returns (this is truncated by me):</strong></p>
  
  <p><a href="https://i.stack.imgur.com/r7cWZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r7cWZ.jpg" alt="Truncated result from the commandline"></a>
  Why is it that the session returns no cookies? How can this be fixed?</p>
  
  <p>I'm using Electron: <code>1.7.5</code></p>
  
  <p>Thanks for your help in advance!</p>