Skip to content

Instantly share code, notes, and snippets.

@jfsiii
jfsiii / gist:814784
Created February 7, 2011 17:33 — forked from paulirish/gist:601751
get and set objects in localStorage and sessionStorage
// Forked from paul irish's https://gist.github.com/601751
// desire: localStorage and sessionStorage should accept objects
// in fact they do according to spec.
// http://code.google.com/p/chromium/issues/detail?id=43666
// but so far that part isnt implemented anywhere.
// so we duckpunch set/getItem() to stringify/parse on the way in/out
// this seems to work in chrome