6

The new html5 specs have a window.sessionStorage and window.localStorage. Is the window.sessionStorage persisted to disk or is it just in the browser app's memory for the time it is open?

Thanks

Chris
  • 3,328
  • 1
  • 32
  • 40
httpete
  • 2,765
  • 26
  • 34
  • Seems like it depends on browsers, similar question is answered [here](https://stackoverflow.com/questions/8634058/where-the-sessionstorage-and-localstorage-stored/15711210#15711210) – Soufiane Tahiri Apr 04 '17 at 13:31
  • 1
    localStorage is not the same as sessionStorage. I understand localStorage is written to the disk., It's the sessionStorage vehicle I am interested in understanding. I would think it's part of the browser ram or window object. – httpete Apr 04 '17 at 14:08

2 Answers2

0

Please refer to these links where local storage/session storage is explained in detail.

HTML5 Local storage vs. Session storage

https://blog.devgenius.io/all-about-localstorage-in-js-4760dbff0b0d

https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API

In browsers that are Chromium(Chrome) based, the data is saved in a SQLite file in the subfolder having the location of /AppData/Local/Google/Chrome/UserData/Default/Local Storage.

Rok Ivartnik
  • 137
  • 5
  • 17
-4

localStorage and sessionStorage both extend Storage. There is no difference between them except for the intended "non-persistence" of sessionStorage.

That is, the data stored in localStorage persists until explicitly deleted. Changes made are saved and available for all current and future visits to the site.

For sessionStorage, changes are only available per window (or tab in browsers like Chrome and Firefox). Changes made are saved and available for the current page, as well as future visits to the site on the same window. Once the window is closed, the storage is deleted.

refer this SO Link

Community
  • 1
  • 1
Sulay Shah
  • 524
  • 2
  • 10