title: Sharing Localstorage token amongst multiple javascript apps on same domain but different subdomains
body: <p>Am trying to implement a single sign in amongst different applications hosted on the same domain but on different subdomains</p>
  
  <p>that is the main app is hosted on mydomain.com and i want to share the token with apps hosted on app1.mydomain.com and app2.mydomain.com</p>
  
  <p>Now by default i usually set my token in localstorage via</p>
  
  <pre><code>       window.localStorage.setItem("access-token", value);
  </code></pre>
  
  <p>and retrieve it via</p>
  
  <pre><code>       window.localStorage.getItem("access-token");
  </code></pre>
  
  <p>But now with the apps hosted on the main domain but on subdomains they fail to access the same localstorage values</p>
  
  <p>How do i overcome this and if there are better methods on this apart from localstorage to store the jwt token</p>