Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

losing the data in local storage that I set on a HTTP page when I move to a HTTPS page #108

Open
crmpicco opened this issue Feb 6, 2015 · 1 comment

Comments

@crmpicco
Copy link

crmpicco commented Feb 6, 2015

I am experiencing an issue where I am losing the data in local storage that I set on a HTTP page when I move to a HTTPS page.

I have upgraded to AmplifyJS 1.1.2 to see if that remedies the issue, but it has no effect.

On the HTTP page I do this:

amplify.store('list_id_to_add', prod_id);
window.location = base_url + '/list/';

On the HTTPS page I got this:

if(amplify.store('list_id_to_add')){        
    // do something...
} else {
    console.log('theres nothing');
}

...but it never finds it.
This code hasn't changed in a long time, so i'm not sure why this isn't working.
I have tested this on FF and Chrome and the issue is prevalent in both browsers.
It doesn't appear to be just this key either, I can't see any values.
Is there anything you can advise?

@jakerella
Copy link
Contributor

This is correct behavior. Local storage is restricted by the same cross-origin policy as ajax requests, which includes restrictions based on protocol (http vs https), full domain (including subdomains), and port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants