If you don't want to use an external code or plugin and don't mind not supporting IE 7, you could always use Local Storage. It's new to HTML 5 and allows you simply to save key value pairs to the browsers local storage using javascript. So if you wanted to save the value 'foo' under the key 'bar' you could do something as simple as:
localStorage.setItem("foo", "bar");
And to retrieve
var foo = localStorage.getItem("foo");
This website shows you what its supported on:
http://caniuse.com/#search=localstorage
And this is a good page for learning a bit about it:
https://developer.mozilla.org/en/DOM/Storage
There are two options with local storage
- Local storage - This is persisted beyond page refreshes
- Session storage - This is persisted while the browser session is still active. When you close your browsers tab, the storage is lost.
Hope this help[s!
Andy