Created
September 21, 2021 05:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const myJWT = 'eyJhbGciOfJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkaWWiOiJka…afyMH0.WrIEBW5LNLjfGWqIA4XKsyIiuWzbIIpNadfZVkmA6hPs'; | |
// store JWT in session storage | |
sessionStorage.setItem('JWT', myJWT); | |
console.log('My JWT is', sessionStorage.getItem('JWT')); | |
// remove JWT from storage | |
sessionStorage.removeItem('JWT'); | |
// clear whole storage | |
sessionStorage.clear(); | |
// localStorage uses the same API | |
// example: localStorage.setItem('JWT', myJWT); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment