Javascript - Session Storage

Session Storage is an alternative to storing information in a cookie so that session information can be maintained using javascript.

//save a value
sessionStorage.setItem("name", "Nicholas");

//retrieve item
var name = sessionStorage.getItem("name");

//get the key name for the first item
var key = sessionStorage.key(0);

//remove the key

//check how many key-value pairs are present
var count = sessionStorage.length;
Here is the example in which we are checking that if there are values in the Session Storage , first load the arrays with those values.

if (sessionStorage.length != 0){
         if(sessionStorage.getItem(i) != null) {

Related Link