0

What is Web storage in html5

Hi Folks !! Today in this post i will discuss the power of web storage.It Comes in HTML5 with this you can save information in web  stockpiling and next time you don’t need to pull your information from your server.This will increase website speed and you don’t need to connect to your server database again and again so it will also reduce server load.Before HTML5 it was difficult to store information in client’s browser.Web Storage is Secure and lots of information can be stored Locally.

Local Storage In HTML5,Session Storage In HTML5,How to Use Web Storage,Use Of WebStorage,Types Of WebStorage,Tutorials of Webstorage in Html5

Benefits of using web storage

* The user has complete control over access to their files and therefore it is really secure in comparison to an online storage where you don’t know where your data is stored and who has access to your data
* The data can be accessed easily and quickly
* The user does not require an internet connection to access the data.
* Improved website performance.

There are two types of web storage.

1. Local (Cookie) Storage
2. Session storage

1. Local (Cookie) Storage

Cookie Local storage is per origin (per domain and protocol). All pages, from one origin, can store and access the same data.

Storing and retrieving data from local storage.

first check, Is it your browser support web storage or not.

Storing data in local storage.

Using setItem() function to store data in local storage you can also store array and json in localstorage.

Retrieve data from local storage.

Using getItem() function to fetch data from local storage.

Deleting local storage.

delete specific key only

delete all localstorege

2. Session Storage

Session storage is just like local storage but it stores data for limited period, As soon as you close the website tab it automatically destroy session storage.

Storing data in session storage.

Using setItem() function to store data in session storage you can also store array and json in session storage.

Retrieve data from session storage.

Using getItem() function to fetch data from session storage.

Deleting session storage.

delete specific key only

delete all session storage

 

Leave a Reply

Your email address will not be published. Required fields are marked *