SessionStorage
SessionStorage is a component of the Web Storage API that provides a per-tab key-value storage area for the duration of a browsing session. Data stored in sessionStorage persists across page reloads and restores within the same tab, but is cleared when the tab or its browsing context is closed. Each tab typically has its own sessionStorage, and the data is scoped to the same origin, meaning it is not shared with other tabs or windows.
The API consists of setItem, getItem, removeItem, clear, a length property, and key(index) to enumerate keys.
Lifecycle and scope: SessionStorage lasts for the lifetime of the tab’s session. It is cleared when the
Usage considerations: SessionStorage is suitable for temporary data needed during a single tab session, such as