DEV Community

loading...

Discussion on: How to securely store JWT tokens.

Collapse
learnitmyway profile image
David

"when a user closes their browser, the JWT will disappear" - I believe browsers can also restore sessions these days.

Collapse
gkoniaris profile image
George Koniaris Author

Hi David, this is specific to sessionStorage. If you mean traditional sessions through cookies, of course, they are able to restore them, actually, they never lose them. Based on MDN sessionStorage is cleared when you close the tab or the browser.