Hi guys, how can I remain logged-in status after closing tab or browser. I have set Authorization for headers request. But I don't know what to do next?
In my Login component screen: I have a function to set token to localStorage
What should I do now ?
Top comments (2)
Increase your token's expiration time. Save it in local storage. Use that in the next time user logs in and use it for requests. It shouldn't has been expired. And if it was redirect the user to welcome page.
Save the token to local storage. After accessing the website, you will need to check whether the token has expired or not. If it has expired, please redirect the user to the login page.