I've looked at a few websites and each of them are slightly different. I understand the basic functionality, but its life time is not so obvious. On Google (Developers) it said it only exists for a specific tab in that instance, but others said you could access it from the same tab or other tabs as long as its the same domain name. Could someone please clear that up for me. Thanks.
Session Storage is a global object that maintains a storage area that's available for the duration of the page session. A page session lasts for as long as the browser is open and survives over page reloads and restores. Opening a page in a new tab or window will cause a new session to be initiated.
Vulnerability to Cross-Site Scripting (XSS) Attacks XSS attacks inject malicious scripts into web applications, and unfortunately, both LocalStorage and SessionStorage are vulnerable to XSS attacks. XSS attacks can be used to get data from storage objects and add malicious scripts to the data stored.
The sessionStorage object stores data only for a session. It means that the data stored in the sessionStorage will be deleted when the browser is closed. A page session lasts as long as the web browser is open and survives over the page refresh.
Session Storage is a global object that maintains a storage area that's available for the duration of the page session. A page session lasts for as long as the browser is open and survives over page reloads and restores. Opening a page in a new tab or window will cause a new session to be initiated.
source: https://developer.mozilla.org/en-US/docs/DOM/Storage
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With