简体   繁体   中英

Could someone explain the life of a sessionStorage object?

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.

source: https://developer.mozilla.org/en-US/docs/DOM/Storage

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM