You have set 1 Hr as session timeout but with in this duration if you try to close the browser this token and localstorage never clear and still the user is logged in only. this is may be the wrong and any others can access using your login. Better for avoid this use react-redux.
@LeelaWebDev3 жыл бұрын
I am saving the date in localstorage when the session is stored and checking the current date when the browser opened with the localstorage saved date
@elonpireva1932 жыл бұрын
what if i just add in localStorage: key: userDetails and fake token will I have access to app ?
@LeelaWebDev2 жыл бұрын
No
@ashrafulmalik14743 жыл бұрын
which token we store in browser refresh token or access token
@Jel.Awesh.M3 жыл бұрын
Is it okay to save token in LocalStorage if it can be read by client?
@LeelaWebDev3 жыл бұрын
Normally we save only the token in local storage instead of saving all the details. Every time we make a request will get a new token which in turn replaces the token in local storage. So the token will be refreshed all the time expiring the old token. In some projects, token will be saved in encrypted format
@Jel.Awesh.M3 жыл бұрын
@@LeelaWebDev Thanks for you response.
@lineupp3 жыл бұрын
@@Jel.Awesh.M It something called refresh token and token is not secure in localstorage or session storage because it can be easily be stoled by hackers using xss attack or csrf attack! I hope you got it! Awesome tutorial leela but i think you missed this little points!
@nishukumar76212 жыл бұрын
Logout automatically deletes cookies
@nishukumar76212 жыл бұрын
Cookie are better than localstorage with https true flag