title: sessionStorage with document.domain
body: <p>According to the spec, I should be able to set the document.domain to my root domain and thus have subdomains share sessionStorage.  But I can't seem to get that to work.  Is that no longer allowed?  <a href="https://html.spec.whatwg.org/multipage/browsers.html#relaxing-the-same-origin-restriction" rel="nofollow noreferrer">https://html.spec.whatwg.org/multipage/browsers.html#relaxing-the-same-origin-restriction</a></p>
  
  <pre><code>// set the document domain to the top level
  let hostParts = location.hostname.split('.').reverse();
  if (hostParts.length &gt; 1)
      document.domain = `${hostParts[1]}.${hostParts[0]}`;
  
  this.sessionId = window.sessionStorage.getItem('hplrSn');
  if (!this.sessionId) this.sessionId = generateId();
  </code></pre>
  
  <p>The above code will generate a new Id for both <code>site1.dn.domain.com</code> and <code>site2.dn.domain.com</code></p>