HTML Web Storage API provides a way for web applications to store and access data locally in the user’s web browser. There are two types of storage available in the Web Storage API: localStorage
and sessionStorage
.
The localStorage
object stores data without an expiration date. This means that the data will not be deleted when the browser is closed, and will remain available even after the computer is restarted. The localStorage
object provides two methods for accessing data: setItem()
and getItem()
.
The sessionStorage
object stores data for a session. This means that the data will be deleted when the browser is closed, and will not be available after the computer is restarted. The sessionStorage
object provides the same two methods for accessing data: setItem()
and getItem()
.