title: Setting a cookie with javascript doesn't work in Poltergeist and/or PhantomJS
body: <p>I have a web page that sets a cookie with <code>document.cookie = value</code>, and it works perfectly while running on the server.</p>
  
  <p>However, in my cucumber tests (with Poltergeist/PhantomJS), the cookies are not persisting from one page to the next.</p>
  
  <p>The test flow is:</p>
  
  <ol>
  <li>page A opens</li>
  <li>user clicks a button, which triggers JS to set the cookie</li>
  <li>user clicks link to page B</li>
  <li>page B has a component that reflects the cookie's value</li>
  </ol>
  
  <p>In a real browser against a running server, it's fine.</p>
  
  <p>But in cucumber, step 4's display shows that it's seeing a blank cookie.</p>
  
  <p>Does anyone know how I can fix or investigate this?</p>