Andy
Andy

Reputation: 10840

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.

Upvotes: 19

Views: 13298

Answers (1)

SKen
SKen

Reputation: 662

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

Upvotes: 35

Related Questions