I'm not sure why, as i've done this before and it worked fine, and i'm thinking it might be because of a browser issue/bug:
localStorage.setItem('foo', 'bar')
alert(localStorage.getItem('foo'));
I'm in Firefox 3.6.6 and it alerts "bar" but if I do:
//localStorage.setItem('foo', 'bar')
alert(localStorage.getItem('foo'));
I get NULL. It should return bar still as it's in my storage.
Also, this is just a web page that it's running on.