Local storage, localStorage, keeps small amounts of data as text key-value pairs in the browser, with no expiration, accessible to all pages of the same origin. sessionStorage lasts for the duration of the tab. You store JSON in it via JSON.stringify, never secrets.
Example
localStorage.setItem('theme', 'dark')
localStorage.getItem('theme')