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

150
Views
Using iframe to access localStorage of subdomain not working?

In app.appname.io I am saving a login session in localStorage. I want to use this session in app.subdomain.appname.io

I am sure that on the app.appname.io I have the data I need in localStorage. The magicLogin function uses the localStorage to automatically authenticate when isCaseworkerLoggedIn returns true. The problem is that when I call the function in the iframe it's like it does not have access to the correct localStorage ie for app.appname.io.

  const magicLogin = () => {
    const isCaseworkerLoggedInStorage = !!localStorage.getItem(
        'isCaseworkerLoggedIn'
    )

    if (isCaseworkerLoggedInStorage) {
        caseworkerLogin()
    }
}

The iframe embed only on the subdomain route I want to use calling the magicLogin onLoad

 <iframe
    src="http://app.localhost:3000/"
    style={{
      display: 'none',
    }}
    onLoad={magicLogin}
 ></iframe>
about 4 years ago · Juan Pablo Isaza
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!