Description
The Web Storage consists of two mechanisms as follows:
sessionStorage
Maintains a separate storage area for each given source (given origin), which is available during a page session (that is, as long as the browser is open, including page reload and recovery).
localStorage
The same functionality, but the data still exists after the browser shuts down and then reopened.
Both of these mechanisms are Window.sessionStorage
used by and Window.localStorage
attributes (more specifically, objects are implemented in supported browsers and Window
objects are WindowLocalStorage
WindowSessionStorage
hung localStorage
under them and sessionStorage
properties)--calling any of these objects creates an Storage
object, by object, you can set, get, and remove data items. For each source (origin) sessionStorage
and localStorage
the use of different Storage objects--run and control independently.
For example, a call in a document localStorage
would return an object, and the Storage
call would sessionStorage
return a different Storage
object. These objects can be manipulated in the same way, but the operation is independent.
Reference:
Https://developer.mozilla.org/zh-CN/docs/Web/API/Window/localStorage
Https://developer.mozilla.org/zh-CN/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API
Https://developer.mozilla.org/zh-CN/docs/Web/API/Window/sessionStorage
Https://www.cnblogs.com/st-leslie/p/5617130.html
HTML5 Local Cache Localstorage and Sessionstorage methods of Operation Collection