Wednesday 7 December 2011

HTML5 Web Storage Methods

Today, I am going to talk about web storage methods in HTML5, for store data HTML5 is work with two basic methods one is permanent storage of data which is known as ‘localStorage’ and the second one is temporary storage of data for specific sessions which are known as ‘sessionStorage’. 

Check below for different HTML5 web storage methods explain by Tampa web design company:

setItem(key,value): This method is use for add key/value pair to the session storage.
getItem(key): This method is use for retrieve value for given keys.
clear(): This method is use for remove all key/values pair from the session storage object.
removeItem(key): This method is removes a key/value pair from the sessionStorage object.
key(n): This is also another method which help to retrieves value for key[n].

Web storage is one of the best feature in HTML5 which include some disadvantages of cookies such as 4Kb size limit, transfer cookie data among server/browser with each request/response. On the other hand using web storage will help in saving bandwidth and because of that reason the data is not being sent over the network it is more secure. The use of new sessionStorage will use two different registered accounts in the own website. With the use of this people can login with different accounts in two browser tabs and also interact with them separation.

No comments:

Post a Comment