HTML5 Web Storage

0 91

HTML5 Web Storage local Storage session Storage Object

in this tutorial we will learn about HTML5 Web Storage local Storage session Storage Object

What is HTML5 Web Storage

Consider an email client while logging in to your email account you need to enter your user name and password. As showing in the picture you can see stay signed in check box specifies that keeps remember your email user name and password by your computer. Traditionally, over the last few decades, web applications using cookies to store small amount of information on client side machine. A cookie is a file that stores user-related information and may either be temporary or permanent.

HTML5 Web Storage local Storage session Storage Object

 

However,the drawbacks of cookies are as follows

Cookies slow down Web application performance as they are included with every HTTP request.
For sensitive data Cookies cannot be considered as safe means for transmission of data .
Cookies have a limitation of size of 4 KB. so can’t store large amount of data
W3C has designed a specification named Web Storage API To overcome these drawbacks to store data on the client-side.

HTML 5 Web Storage

Web storage specified by W3C.it provide functionality to store data on user machine. This data can be store for both temporary or for permanent needs. Certain browsers also refer to it as ‘DOM Storage’. The advantage of such storage is more control able than traditional cookies. It enables to store a maximum of 5 MB of information per domain.

Exploring Web Storage

There are two types web storages in html5 and they are session storage and local storage. Both storages enables store 5mb data information per domain. before going into debut of session and local storage we have to check either browser supports to the web storage or not session and local storage is available as a global variable for windows object. If there is no support, the local Storage or session Storage property will be undefined.

The local Storage

The local storage object keeps store the user information data without expiration date this data will not be deleted when user closed the browser windows it will be available for day, week, month and year.

The session Storage Object

The session Storage Object is same like local storage date except it will delete all windows when browser windows closed by a web user.

Comments

comments

Leave A Reply

Your email address will not be published.