Home
Documentation
Examples
Browser and Web APIs
Exercise: Web Storage
Use the Web Storage API to store the authentication token in the
login
JavaScript and to retrieve it in the
chat
JavaScript.
Add a checkbox to the login form and update the
loginUser
function so that the token is kept after closing the browser, if the checkbox is checked.
In the JavaScript
chat
, register an event handler on the
Logout
link that deletes the token.