title: Local storage using redux toolkit
body: <p>I would like to keep my isAuthenticated state in local storage, so after refreshing the page, the user will be logged in. I tried straightforward, to set it ti true/false in localStorage and to set initial value of my state in redux to this value, but it always sets it to true.</p>
  <p>Here's my redux store</p>
  <pre><code>import { createSlice, configureStore } from '@reduxjs/toolkit';
  
  //MOVEMENTS (doesn't work yet)
  const initialMovementsState = {
    movements: [],
  };
  
  const movementsSlice = createSlice({
    name: 'movements',
    initialState: initialMovementsState,
    reducers: {
      add(state) {
        //nothing yet
      },
      decrement(state) {
        //nothing yet
      },
    },
  });
  
  //LOGGING IN/OUT
  const initialAuthState = {
    isAuthenticated: false,
  };
  
  const authSlice = createSlice({
    name: 'auth',
    initialState: initialAuthState,
    reducers: {
      login(state) {
        state.isAuthenticated = true;
      },
      logout(state) {
        state.isAuthenticated = false;
      },
    },
  });
  
  //STORE CONFIGURATION
  
  const store = configureStore({
    reducer: {
      movements: movementsSlice.reducer,
      auth: authSlice.reducer,
    },
  });
  
  export const movementsActions = movementsSlice.actions;
  export const authActions = authSlice.actions;
  
  export default store;
  </code></pre>
  <p>All answers I found are with redux only, not with redux toolkit and I'm kinda fresh to redux, so I'm lost.</p>