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

171
Visualizações
Session variables getting lost when navigating to a different controller (& AJAX requests), however session vars set during Session_Start is intact

This question is about an issue we are facing with a .net framework based MVC app that uses windows authentication. The variables set during Session_Start seems to be just fine and available throughout, but any session variable set after the fact seems to be lost. In the output below, first line is where we set a session variable. The exception is when I am trying to access it in a different page. However if you notice other session variables set during Session_Start are still available. This is issue 1.

Current session value (home): zero
---
(different page)
System.NullReferenceException: Object reference not set to an instance of an object.
   at ---removed---
   at ---removed---
Id (from session): 0
Name (from session): Admin
Email (from session): admin@admin.com

We explored further and it also seems like AJAX requests are creating a whole new session. This is issue 2. We have tried a number of things - update the $.ajax call to xhrfields/withCrdentials, tried setting an AutoRedirectMode using the FriendlyUrls package, tried ignoring a few routes suggested, etc. But nothing helps. So any pointers regarding this would be appreciated.

Thanks!

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

We found the issue. Looks like some process (most likely the anti-virus) is messing with the bin directory causing the application to be restarted again and again. So we added the fcnMode attribute to the httpRuntime element and set it to Disabled so as to disable the behavior for now.

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