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

421
Views
Logging out from tab, not working for all other tabs

I've implemented login functionality using custom cookie authentication and its working well.

When I am logging out from one tab it is working find, once use do log out user will redirect to logout screen. but when I have opened more than one tab, user can still access the pages in other tab.

If I do refresh the page in other tab, user is logging out.

It is working only if I manually refresh the page, how can I logout user without refresh the page.

How can I refresh application state.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You have to continuously make an Ajax call to server or refresh the page through meta tag in a fixed interval of time. But it's not a good idea as design. If you use custom cookie follow here.

over 4 years ago · Santiago Trujillo Report

0

In Blazor, every tab runs on a different blazor session Id. Therefore, even when you log out, it will not automatically log you out from the rest of the opened tab. It is the expected behavior. They all are using the same object but with different session ids. Therefore, whatever changes happen in one of the tabs will not reflect in the others. One way to communicate between multiple tabs is to use local storage. It is the place that all browser tabs share commonly.

In my current Blazor application, I have done something similar. After login, I have added a key-value pair (e.g., date timestamp) into the browser's local storage. Additionally, a setInterval() is registered, which tracks the user's activity. It also checks for the key added at the time of login. Log out from any of the tabs remove the key. When other browser tabs do not find that key, they redirect to the login page.

over 4 years ago · Santiago Trujillo 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!