title: How To Use LocalStorage with MSAL.js
body: <p>How do I use LocalStorage with <a href="https://github.com/AzureAD/microsoft-authentication-library-for-js" rel="nofollow noreferrer">MSAL.js</a>?</p>
  
  <p>According to <a href="https://htmlpreview.github.io/?https://raw.githubusercontent.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/docs/classes/_useragentapplication_.msal.useragentapplication.html#cachelocation" rel="nofollow noreferrer">this</a>, there's a property, cacheLocation, I need to set to 'localStorage'.</p>
  
  <p>The following is still using sessionStorage:</p>
  
  <pre><code>var clientApplication = new Msal.UserAgentApplication(applicationConfig.clientID, applicationConfig.authority, function (errorDesc, token, error, tokenType) {
          // Called after loginRedirect or acquireTokenPopup
      });
  clientApplication.cacheLocation = 'localStorage';
  </code></pre>