Single Choice Question

  1. What is the difference between local storage and session storage?
    1. Local storage is persistent, session storage is not.
    2. Local storage is not persistent, session storage is persistent.
    3. Local storage is persistent, session storage is persistent.
    4. Local storage is persistent, session storage is persistent.
  2. The method to get the value of a cookie is
    1. getCookie()
    2. getCookies()
    3. getCookieValue()
    4. getCookieName()
  3. The content of cookie used to specify the date and time when the cookie is out of date is
    1. expires
    2. expire
    3. max-age
    4. path
  4. To save lots of data in the browser, which of the following is the best way to be used?
    1. localStorage
    2. sessionStorage
    3. cookie
    4. indexedDB

True or False Question

  1. The cookie is used to store data in the browser.
  2. The local storage is persistent, session storage is not.
  3. When the user closes the browser, the data in the cookie will be lost.

Definition of Term

  1. Cookie
  2. Local Storage
  3. Session Storage
  4. IndexedDB

Short Answer

  1. What are the differences between local storage and session storage?
  2. Try to compare cookie with storage?