jStorage icon indicating copy to clipboard operation
jStorage copied to clipboard

What is the scope of the data?

Open cmeeren opened this issue 8 years ago • 5 comments

Forgive me if I have overlooked this somewhere, but what is the scope of the stored data? Can I set data in one page (example.com/foo) and retrieve it in another page on the same domain (example.com/bar)?

To be clear, I definitely don't want this - I need to know if this is something I deliberately need to avoid by namespacing my keys in some way. I want to store separate values for the key baz on the two pages example.com/foo and example.com/bar.

cmeeren avatar Apr 04 '16 18:04 cmeeren

It's a straightforward Key-value store IIRC. There is no page context.

mezza avatar Apr 04 '16 18:04 mezza

Does that mean that the keys are accessible even across domains? E.g. that example1.com can set the key baz and example2.com can read it?

cmeeren avatar Apr 04 '16 18:04 cmeeren

No

mezza avatar Apr 04 '16 20:04 mezza

Then does it mean that key baz stored on example.com/foo is visible from example.com/bar? You're sure?

cmeeren avatar Apr 04 '16 20:04 cmeeren

Yes, you can read key baz from example.com/foo and example.com/bar

mezza avatar Apr 07 '16 10:04 mezza