Redirect to login screen constantly ASP.NET MVC

0

Constantly while browsing the site the user is being redirected to the login screen. I myself navigate several screens by clicking the menus and randomly the system goes to the login. I already set the timeout of the session with a fairly high time and could not find out. I already have several weeks working on it and without solution. Can you help? follow my webconfig.

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="entityFramework" 
      type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, 
      EntityFramework, Version=6.0.0.0, Culture=neutral, 
      PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
 </configSections>
 <connectionStrings>
     <add name="DefaultConnection" 
  connectionString="xxxxxxxxxxxxxxx" providerName="MySql.Data.MySqlClient"/>
 </connectionStrings>
 <appSettings>
    <add key="webpages:Version" value="3.0.0.0"/>
    <add key="webpages:Enabled" value="false"/>
    <add key="ClientValidationEnabled" value="true"/>
    <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
 </appSettings>
 <system.web>
    <httpCookies httpOnlyCookies="true" requireSSL="true"/>
    <globalization culture="pt-BR" uiCulture="pt-BR" enableClientBasedCulture="false"/>

 <customErrors mode="Off"/>
 <authentication mode="None"></authentication>
 <compilation debug="true" targetFramework="4.7.2"/>
 <sessionState mode="InProc" timeout="60" />
 <httpRuntime requestValidationMode="2.0" targetFramework="4.7.2"/>
 <httpModules>
   <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
 </httpModules>

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    
asked by anonymous 23.09.2018 / 22:40

1 answer

0

Resolved, the problem was machineKey in web.config . Since I was using farm-type hosting, the application lost the token. I just added the line below and resolved.

<system.web>
    <machineKey validationKey="83BDD6F29FEF43C0256106B322F775DE77D8704CC3A5E07B9D2BD2253337374A3A64DD466D6A2CA81C6FBF27F6BFF637FC24CE8C17B0540BB191E07B90CB5DC0" decryptionKey="4411595512AD6A65D5C09842DB764FA1BAAC04A37FD6C7E4827D42ED8F8C496E" validation="SHA1" decryption="AES" />
</system.web>
    
03.12.2018 / 01:01