Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
Fetch another site's localstorage data

I have two different site's data stored in localstorage, let's say xyz.com and abc.com. The thing is i can only access the data in which site I'm currently on. How can I access localstorage of abc.com if I'm on xyz.com?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

As others have already pointed out in the comments this is not possible.

If you read the documentation for Web Storage API (which consists of both localStorage and sessionStorage) you will see this.

A different Storage object is used for the sessionStorage and localStorage for each origin — they function and are controlled separately.

An origin in this context is defined as this.

Web content's origin is defined by the scheme (protocol), hostname (domain), and port of the URL used to access it. Two objects have the same origin only when the scheme, hostname, and port all match.

https://developer.mozilla.org/en-US/docs/Glossary/Origin

Since you in your example have two different hostnames, they are separate origins and therefore can't access each others localStorage.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!