Session Storage
In constrast to Local Storage, session storage will be cleared after browser tab is closed or window is closed
Session Storage data is limited to the current tab and not shared with other tabs or windows from the same origin.
API
// Storing data in sessionStorage
sessionStorage.setItem('key', 'value');
// Retrieving data from sessionStorage
const value = sessionStorage.getItem('key');
// Removing data from sessionStorage
sessionStorage.removeItem('key');