title: Nuxt Vuex Store Cookies Issue
body: <p>Good time of the day!  </p>
  
  <p>After a few weeks of development of my project, i've decided to migrate from plain Vue to Nuxt. </p>
  
  <p>Mainly because i need SSR, although i know that Google can execute JS presented on the page and therefore generate appropriate content for their search bot.  </p>
  
  <p>Another reason is a general workflow of the project development. I like idea with automatic instantiation of routes, store, etc.</p>
  
  <p>I've faced, however, a pretty strange behavior of the application when it is running in the <code>mode: universal</code> instead of <code>mode: spa</code>. And i don't want to switch to <code>mode: spa</code> since then i lose the SSR i was migrating for in the first place.  </p>
  
  <p>I' have an account module in the store - <code>account.js</code> which is responsible for handling any operations related to the account management, such as login/logout, get profile of authenticated user, store the token obtained from the login request as well as the logic for handling the 2FA TOTP procedure.</p>
  
  <p>In my <em>legacy</em> application, i was able to get the token from the cookies by just using the following bit of the code  </p>
  
  <pre><code>import Cookies from 'js-cookie';
  
  export const state = {
     user: null,
     token: Cookies.get('token')
  }
  </code></pre>
  
  <p>And save token after the successful authentication by executing the following mutation:</p>
  
  <pre><code>[types.ACCOUNT_SAVE_TOKEN] (state, { token, remember }) {
      state.token = token;
      Cookies.set('token', token, {
        expires: 365,
        httpOnly: true
      });
  }
  </code></pre>
  
  <p>But after migration to <strong>Nuxt.js</strong>, every time im loggin in, the token value in the state is getting populated, but no cookie is set, and after navigating to the other page inside the project (it is pwa, so no reloading, etc) token is reset back to null.</p>
  
  <p>This issue however is gone if application is switched to the <code>mode: spa</code> from <code>mode: universal</code> and everything is working just fine. </p>
  
  <p>I've read many issues on the github as well as done pretty big portion of crawling throught the websites which are trying to solve the same issue, though none of the suggestions are working for me.  </p>
  
  <p>I've even installed the <a href="https://www.npmjs.com/package/cookie-universal-nuxt" rel="noreferrer">cookie-universal-nuxt</a> package from NPM which claims to be working with the SSR, but yet every time I'm trying to access <code>this.$cookies.get('token')</code> in the state, or anywhere else (mutations for example), I'm just getting error about using the method (get/set/remove) on <code>null</code>.</p>
  
  <p>Does anyone know or have an idea on how to overcome this issue, at least if it is possible without going back to the <code>mode: spa</code>? </p>
  
  <p>P.S. Running <code>npm run build|generate</code> yields same files as for the normal vue (without the content, just the structure until the target element is readched) while in <code>mode: spa</code>.</p>