Reputation: 151
The login token is being archived using local storage in the react. I want to keep the token intact even if I remove the browser's tab and delete the login information by removing the token when I remove the browser itself. Session storage cannot be used because information disappears when a tab is deleted Does anyone know how to do this?
Upvotes: 0
Views: 1977
Reputation: 4938
Use localStorage instead. The API is the same. And it persists even after the tab is closed.
You could read the docs here => https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
Upvotes: 1