In the past I have used PersistJS (http://pablotron.org/?cid=1557) for this. Are there reasons to prefer one or the other of these libraries?
PersistJS falls back on flash and cookies, which is bad (flash slows down browser during page loading, cookies fatten your network requests). Store.js uses localStorage, globalStorage and IE behaviors which do not have those negative side effects.