JavaScript - Local Storage

Learning from XAuth: Cross-domain localStorage
Local Storage And How To Use It On Websites
Boost Ajax performance using local storage

// JavaScript - Difference between a cookie, sessionStorage and localStorage:

Cookies are sent to the server on each subsequent requests.  sessionStorage
and localStorage are not sent to the server.  sessionStorage ends when the
the browser is closed, and the data that is stored in sessionStorage is gone.
Data that is stored in localStorage are not destroyed when the browser is 

// Using localStorage
// Use the setItem() and getItem() method of the window.localStorage object:
var taste = localStorage.getItem('favoriteflavor');

// We cannot directly store objects in localStorage, so we have to use
// JSON.stringify and JSON.parse:
localStorage.setItem( 'car', JSON.stringify(car) );
JSON.parse( localStorage.getItem('car'))
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License