Store and Retrieve Object with SessionStorage

var student = {
    id: 'st01',
    name: 'Name 1',
    age: 20
};
sessionStorage.setItem('student', JSON.stringify(student));

var studentInfo = JSON.parse(sessionStorage.getItem('student'));
console.log('Student Info');
console.log('id: ' + studentInfo.id);
console.log('name: ' + studentInfo.name);
console.log('age: ' + studentInfo.age);
Student Info
id: st01 
name: Name 1 
age: 20