We are seeing this behaviour:
This doesn't have to be on the same machine, somebody coming to the secured page on another machine sees the auth details of the original user.
I don't know if this is a bug as it seems quite critical so I'm guessing I may be doing something wrong. My current workaround is to add this code to my store actions:
async nuxtServerInit ({ state, dispatch }, { req }) {
if (req.headers.cookie) {
const cookies = cookieparser.parse(req.headers.cookie)
if (!cookies.auth) {
await dispatch('logout')
}
}
}
@dfcook Which version are you using ?
@Syffs 4.0.0-rc.3
@dfcook Do you have the same problem using the dev branch ?
@dfcook check your store, this kinds of things happens when state is an object and always is passed by reference, because of this your state is the same instance for all users.
Bad example:
store/index.js
const state = {
isMenuOpen: false
}
const createStore = () => {
return new Vuex.Store({
state
})
}
Good example:
store/index.js
const createStore = () => {
return new Vuex.Store({
state: {
isMenuOpen: false
}
})
}
I hope this will help.
There shouldn't be any general issue with 4.0.1. Please reopen if you are sure this problem still exists.

The state object was the issue, thanks it is now resolved.
@dfcook check your store, this kinds of things happens when state is an object and always is passed by reference, because of this your state is the same instance for all users.
Bad example:
store/index.jsconst state = { isMenuOpen: false } const createStore = () => { return new Vuex.Store({ state }) }Good example:
store/index.jsconst createStore = () => { return new Vuex.Store({ state: { isMenuOpen: false } }) }I hope this will help.
thank you so mouch . this problem has bothered me whole day.
if u are using nuxt auth u can try
this.$auth.strategy.token.reset();
Most helpful comment
@dfcook check your store, this kinds of things happens when state is an object and always is passed by reference, because of this your state is the same instance for all users.
Bad example:
store/index.js
Good example:
store/index.js
I hope this will help.