top of page

session storage

  • zenrays15
  • Feb 15, 2017
  • 1 min read

Html5 introduced web storage techniques to allow the data to be saved on the client device. Local storage and session storage are the two types of web storage. The main difference between them is that the session storage is available till the browser window is open. If the window is closed, the storage associated with that window will also be closed. Local Storage is opposite of session storage. The data stored in the browser will remain even if the window is closed. Session storage is Key/value hash table to store data. This storage is not persistent and goes off if the tab is closed or the browser is closed. It is scoped to a domain name. The data stored in one domain will not be available to other domains or web pages. It can only store string values. sessionStorage.setItem('key',somevalue); It is the method used to store a value with the key provided. For example, sessionStorage.setItem('key',zenrays); sessionStorage.getItem('key'); It is the method used to get the item which was stored before. For example, sessionStorage.getItem(zenrays); sessionStorage.removeItem('key'); It is the method used to remove the item which was stored. For example, sessionStorage.removeItem(zenrays); sessionStorage.length - It returns the number of items stored.

ZenRays provide the following to make you expertzenrays providing html5 training in Bangalore Fully practical and project-based sessions from first class.Training by Experienced Consultants, not regular TrainersFriendly and enthusiastic faculty to clear your doubts 24X7Free Live project after the training to get you industry experience

If you want more details please visit us:

Zenrays.com Reach us at trainings@zenrays.com sessionStorage.key(index) - It returns the key stored at particular index

 
 
 

Comments


You Might Also Like:
bottom of page