Question: how often is local storage cleared?
Answer: localStorage is similar to sessionStorage , except that while data stored in localStorage has no expiration time, data stored in sessionStorage gets cleared when the page session ends — that is, when the page is closed.