Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

420
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda