1.

Explain HTML5 Web storage.

Answer»

HTML5 has many great features, including Web Storage, which is sometimes referred to as DOM storage (Document OBJECT Model Storage). Web applications can use Web Storage to store DATA locally in the browser on the user/client’s side. Data is stored in the form of a key/value pair in the user's browser. Using web storage to store data is similar to using cookies, but web storage is faster and more convenient. Web Storage should never be used to store SENSITIVE data. It isn't "more secure" than cookies since it isn't transmitted over the wire and isn't encrypted.

Types of Web Storage:

As outlined below, there are two types of web storage with different scopes and lifespans:

  • LOCAL Storage: This storage uses Windows.localStorage object that stores data with no expiration DATE. Once stored in local storage, the data will remain available even after the user's browser is closed and reopened.
  • Session Storage: This storage uses the Windows.sessionStorage object that stores data for one or single session only. As soon as the user closes his browser, data is lost or deleted from the browser, and the session would be lost. 


Discussion

No Comment Found