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

134
Views
Retain state on new tab, but not page refresh

I am trying to have a JS state that is retained when user opens a new tab (or new window), but is not retained on explicit page refresh. Is that possible in JS ?

So I am trying to somehow achieve reverse of what sessionStorage can give which states as per MDN docs; Opening a page in a new tab or window creates a new session with the value of the top-level browsing context, which differs from how session cookies work.

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

0

Sounds like you could keep the state in local storage. When the page is loaded, check if a session storage value exists - if so, don't retrieve the data from local storage. Otherwise, if the session storage value doesn't exist, it's a new page, in which case you can retrieve the state from local storage.

Regardless, whenever a page is loaded, set a session storage value so it can be read later by the above logic, in case the page gets refreshed.

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!