Home

Issue: 1467

strange bug - Store state is leaking across clients

[issue link]

The state injected by nuxt to the nuxtServerInit contains data from other client

Reproductions:

  1. Go to the page with BROWSER_1
  2. Click on “Click”, you will see random number XXX
  3. Close BROWSER_1
  4. Open BROWSER_1 and go to the same page.
  5. You will see number XXX generated previously (this is ok - was read from the cookie)
  6. Close BROWSER_1
  7. Open BROWSER_2 (or use incognito)
  8. Go the the same page. You will see number XXX that was generated for the first user!!

You can check log console in glitch.

  async nuxtServerInit ({ state, dispatch, commit }, { req }) {
    console.log('actions.nuxtServerInit state = ', state)
    [...]

This output the state from the previous client.

Page:
https://nuxt-rc6-store-state.glitch.me/

Code:
https://glitch.com/edit/#!/join/5d93dc85-6bb8-4d6c-a604-23dbf803eca5

This question is available on Nuxt.js community (#c1307)