The Web Storage API provides mechanisms by which browsers can store key/value pairs, in a much more intuitive fashion than using cookies.
Published: 13 Feb 2020
sessionStoragemaintains a separate storage area for each given origin that's available for the duration of the page session (as long as the browser is open, including page reloads and restores)
localStoragedoes the same thing, but persists even when the browser is closed and reopened.
(source : MDN)