title: Why do two web pages have different localStorage? How can I fix this?
body: <p>I'm trying to pass a value from one page to another using localStorage.
  Both pages use a common JS file to get/set values from localStorage.
  This page sets the value appropriately using <code>localStorage.setItem('key', 'value')</code>: <a href="http://example.com/path/index.html" rel="nofollow noreferrer">http://example.com/path/index.html</a></p>
  
  <p><code>ip</code> is parsed from the query string and written to localStorage with key <code>db_ip</code>.</p>
  
  <p>When I try to do <code>localStorage.getItem('db_ip')</code> on this page, then the item is not there: <a href="http://www.example.com/path/page.html" rel="nofollow noreferrer">http://www.example.com/path/page.html</a> </p>
  
  <p>I'm reading specs that say <a href="http://dev.w3.org/html5/webstorage/#the-localstorage-attribute" rel="nofollow noreferrer">"every Document object whose Window object's localStorage attribute's Storage object is associated with the same storage area"</a>, so this makes me think pages can have separate localStorage by having a different Storage object.</p>
  
  <p>I can see the Storage object is different between the two pages. How to I make both pages use the same Storage object?</p>