title: How can I fix "sessionStorage is not defined" in Svelte?
body: <p>I'm new in Svelte and I'm trying to set some info into sessionStorage but it is throwing "sessionStorage is not defined".
  I realised that I received this error because it's running on the server side.</p>
  
  <p>I created a component at <em>/src/components/nav.svelte</em> that uses <em>/src/domain/auth/service.js</em> and the error occurs in the last one.</p>
  
  <p>Searching on the web I found that in this case I must use <strong>sessionStorage</strong> inside <strong>onMount</strong> function. Is that the right way?</p>
  
  <p>How can I avoid that my code get a little mess?</p>