wojodesign/local-storage-js — Issue #2: IE7 key:value pairs persist across single pages but not entire domain
Author: leereamsnyder
Created: 2012-03-01 20:14:19+00:00
State: open

It's entirely possible that I'm missing something here, but in IE7 the key:value pairs are not persisting across the entire domain.

They are persisting across page refreshes and browser restarts *for individual pages*, but as soon as I go to a different page on the same domain, the data is no longer there.

Here's what I'm doing. I'm trying to store a setting across pages. After I load your script, I test if a localStorage value exists already. If it doesn't exist, then I create/set the value:

var settingExists = typeof localStorage.getItem('theKey') === "string";

if ( !settingExists ) {
localStorage.setItem("theKey", "the value");
}

That works great on a page refresh. But when I go to a different page on the same domain, localStorage.getItem('theKey') returns null (where I would expect it to be set already from the previous page).

Am I missing something really basic here?