0

I find myself asking this question over and over without finding the right answer so I decided to write it down here for you to share your knowledge.

I love to use localStorage API from new browsers to store little pieces of information related to my website behavior.

I know localStorage is rules by the same origin policy which stands that you can only have access to the localStorage bucket for your domain (including hostname, port and PROTOCOL). My problem is with the protocol...

In my case, we have http areas of our e-commerce site (catalog navigation) and https ones (checkout process). So I have this problem where I can't read any information in our checkout process which have been setted on the catalog navigation area.

I think this might be a common pattern and I don't understand why I'm not allowed to do it.

Maybe you know why this is so, if there is any way to hack this or another alternative (not including cookies).

Thanks!

PaquitoSoft
  • 3,177
  • 6
  • 29
  • 32
  • 2
    http://stackoverflow.com/questions/10502469/is-there-any-workaround-to-make-use-of-html5-localstorage-on-both-http-and-https – Paul Grime Apr 04 '13 at 11:36
  • Yes, that was the same question (my fault) and the answer is a good hack idea. Anyway, I would like to know why the spec is so restrictive with this API. – PaquitoSoft Apr 04 '13 at 17:19
  • I wanted to note that iFrame hack forces your user to make an extra call to your server. – PaquitoSoft Apr 18 '13 at 11:20
  • Possible duplicate of [Is there any workaround to make use of html5 localstorage on both http and https?](http://stackoverflow.com/questions/10502469/is-there-any-workaround-to-make-use-of-html5-localstorage-on-both-http-and-https) – Kamiccolo Feb 07 '17 at 20:36

0 Answers0