what is HTML storage?

Emily

New member
It's one of the greatest features of HTML5, known as Web Storage. With the help of a web storage feature, the data is stored locally in the browser on the client-side, on the Web applications. It stores data in the form of key-value pair on the browser. Sometimes, web storage is also known as DOM storage.

Web Storage and cookies have some relationship; due to which storing data with the help of web storage is like storing a cookie, but it's better and fast as compared with the storage of cookies.

Types of Web Storage


There are two types of web storage with different scope and lifetime.

  • Local Storage: Local Storages uses Windows.localStaorage object which stores data and available for every page. But data persist even if the browser is closed and reopened (Stores data with no Expiration).
  • Session Storage: Session Storage uses the Windows.sessionStorage object which holds data for one session, and the data is lost if the window or browser tab will be closed.
 
Back
Top