Browser and Web APIs

Exercise: Web Storage

  1. Use the Web Storage API to store the authentication token in the login JavaScript and to retrieve it in the chat JavaScript.
  2. 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.
  3. In the JavaScript chat, register an event handler on the Logout link that deletes the token.