Static GitHub Issues

[3176] Can't get individual cookies of client. Cookies are setted globally

prev: Master branch?
next: Nuxt.js auto completion in Vetur
<!-- IMPORTANT: Please use the following link to create a new issue: https://nuxtjs.cmty.io/issues/new If your issue was not created using the app above, it will be closed immediately. -->

I handled authentication with cookies in Nuxt, the code is as bellow:

 nuxtServerInit ({ commit, state }, { req }) {

    console.log('nuxtServerInit')

    if (req.headers.cookie) {
      let cookieParsed = cookieparser.parse(req.headers.cookie)

      // console.log(cookieParsed)
      if (cookieParsed.token !== undefined && cookieParsed.userId !== undefined) {
        // console.log('parsed.token', cookieParsed)
        let token = null
        token = cookieParsed.token
        state.userId = cookieParsed.userId
        commit('auth/setToken', token)
      }
    }
  },

But, while I test and I login I could access succesfully to my account. But if I try in another Pc or in a new incognito window in Chrome I could access to the same account that I did before. How is it possible? It seems cookies are stored globally. But in the code I get cookies from req (the client request). Please let me know what I missed out.

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c6825">#c6825</a>)</em></sub></div>