HTML5 Local Storage and Session Storage

In our web application we need to store data. We can do this in different ways and we can store our data on client side as well as server side. We can choose any of them according to our need and level of security policy. HTML5 introduces two mechanisms, session storage and local storage for storing data on the client side. Let’s discuss on these. Summary of the article:

What is HTML Local Storage?

What is HTML Session Storage?

What is HTML Local Storage?
By using local storage web applications can store data locally within the user’s browser. It persists the data until the user explicitly deletes the data. Local storage data is available even after the browser is closed and reopened. An example is given bellow:

What is HTML Session Storage?
Session storage is similar to local storage except that it stores the data for only one sessions. It persists data until the user close the specific tab/window. An example is given bellow:

About Author

Rashed

I’m Rashedul Alam, software engineer/architect, technical blogger, and educator. I have over 10 years of working experience in the field of software design and development. I like to share my knowledge and technical stuff with others. I am a community contributor, providing problem solving answer through different forum.