title: LocalStorage not working after storing token
body: <p>I am storing JWT token in LocalStorage after Login success is dispatched and routing to next component. But the next component API call is not able to take LocalStored token. </p>
  
  <p>If i refresh the page and click again, it is accepting the token. Dont know the issue. </p>
  
  <p>This is Axios Instance and Login Dispatch respectively</p>
  
  <pre><code>const instance = axios.create({
      headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/json; charset=utf-8',
          'x-access-token': localStorage.getItem('accessToken'),
      },
      withCredentials: true,
      validateStatus: (status) =&gt; status === 200
  });
  </code></pre>
  
  <pre><code>export function checkLogin(data, history) {
      return function (dispatch) {
          return dispatch(makeAPIRequest(loginAPI, data)).then(function (response) {
              if (response.data.success == 1) {
                  localStorage.removeItem('accessToken')
                  localStorage.setItem('accessToken', response.data.data.token)
                  dispatch({ type: STORE_SESSION_TOKEN, authenticated: response.data.data.auth, token: response.data.data.token,userDetails: response.data.data.user });
                  history.push('/dashboard')
              }
          })
      }
  }
  
  </code></pre>
  
  <p>Expecting to take token from Localstorage from very next call from Dashboard. But that doesn't happen. says no token and redirects to Login</p>