title: Vuex : token doesn't stored in local storage
body: <p>I have this store in Vue App using vuex :</p>
  <pre class="lang-vue prettyprint-override"><code>import Vue from 'vue'
  import Vuex from 'vuex'
  import axios from 'axios'
  
  Vue.use(Vuex)
  
  export default new Vuex.Store({
    state: {
      email: null,
      token: localStorage.getItem('token') || null,
      role: null
    },
    mutations: {
      saveToken (state, token) {
        state.token = token
      }
    },
    actions: {
      createToken (context, user) {
        axios.post('http://127.0.0.1:8001/api/user/login', {
          email: user.email,
          password: user.password
        }).then(response =&gt; {
          const token = response.data.token
          localStorage.setItem('token', token)
          context.commit('saveToken', token)
        })
      }
    },
    modules: {
    }
  })
  </code></pre>
  <p>When I login the token state is changed correctly, but when I refresh the page the state is null again.</p>