HTML5 Local storage vs. Session storage

后端 未结 10 2239
甜味超标
甜味超标 2020-11-22 03:16

Apart from being non persistent and scoped only to the current window, are there any benefits (performance, data access, etc) to Session Storage over Local Storage?

10条回答
  •  囚心锁ツ
    2020-11-22 03:50

    • sessionStorage maintains a separate storage area for each given origin that's available for the duration of the page session (as long as the browser is open, including page reloads and restores)

    • localStorage does the same thing, but persists even when the browser is closed and reopened.

    I took this from https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API

提交回复
热议问题