Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

206
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda