sessionStorage
sessionStorage keeps string values for the current page session and normally clears them when the tab session ends.
sessionStorage.setItem('draft', 'Step one'); const draft = sessionStorage.getItem('draft');Use it for temporary state that should not be shared as a long-term preference. It is still readable by scripts on the same origin.