While working on a web app using Vuejs, I encountered an issue with storing the jwt token in localstorage. Every time I close the tab, the token gets lost and requires me to login again. Interestingly, the app works fine in Opera GX but not in Google Chrome.
This is how I set the token :
localStorage.setItem("token", token);
And this is how I retrieve it :
let token = localStorage.getItem("token");