DWQA QuestionsCategory: ProgramLocalstorage cannot get values in other windows
max_ Tank asked 2 months ago

clipboard.png
clipboard.png
The same browser created in this window can go to, but not in another window, I don’t know why!

max_ Tank replied 2 months ago

Why

max_ Tank replied 2 months ago

Give me a little advice. I’m still learning. Is to learn some Chrome browser debugging. You can check whether the pages are stored successfully in Chrome’s application / local storage.

1 Answers
Aite veteran cadre answered 2 months ago

Localstorage is also scoped and only works in the same domain. For example, where are youhttp://a.comThe value of localstorage set under can only be used inhttp://a.comTake it out from the bottom. Now the addresses of your two windows should be in different domains, so they can’t be accessed.

max_ Tank replied 2 months ago

OK, I see

Aite veteran cadre replied 2 months ago

OK, accept the answer