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? https://html.spec.whatwg.org/multipage/browsers.html#relaxing-the-same-origin-restriction
// set the document domain to the top level
let hostParts = location.hostname.split('.').reverse();
if (hostParts.length > 1)
document.domain = `${hostParts[1]}.${hostParts[0]}`;
this.sessionId = window.sessionStorage.getItem('hplrSn');
if (!this.sessionId) this.sessionId = generateId();
The above code will generate a new Id for both site1.dn.domain.com
and site2.dn.domain.com