应用程序在多个选项卡中打开时注销问题

问题描述:

我正在面对我的MVC5应用程序中的注销问题。



如果我打开标签1,完成我们的工作并保持打开,然后打开标签2并继续在标签2中工作15分钟,标签1将返回到登录页面,因为自动注销(在web.config中15分钟内设置超时)。


$ b $下面的b是web.config配置





I am facing the log out issue in my MVC5 application.

if I am opening tab 1, finish our work and leave it open, then open tab two and continue working in tab two for 15 minutes, tab one will return to the log in page due to automatically logout(Timeout set in 15 minutes in web.config).

below are the web.config configuration


<system.web>
    <httpCookies httpOnlyCookies="true" />
    <customErrors mode="On">
      <error statusCode="500" redirect="~/Error/InternalServer" />
      <error statusCode="404" redirect="~/Error/Index" />
      <error statusCode="403" redirect="~/Error/BadRequest" />
      <error statusCode="401" redirect="~/Unauthorised/Index" />
    
    <caching>
      <outputCache enableOutputCache="false" enableFragmentCache="false" />
    
    <!--<customErrors mode="On" defaultRedirect="Error" redirectMode="ResponseRedirect" />-->
    <authentication mode="Forms">
      <forms loginUrl="~/Account/LogOff" protection="All" timeout="1" slidingExpiration="true" cookieless="UseCookies" requireSSL="true" />
    
    <compilation debug="true" targetFramework="4.5.1">
      <assemblies>
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      
    
    <!--<httpRuntime targetFramework="4.5"  />-->
    <httpRuntime executionTimeout="99999" maxRequestLength="162529280" maxUrlLength="400" minFreeThreads="6" useFullyQualifiedRedirectUrl="false" />
    <pages>
      <namespaces>
        <add namespace="Kendo.Mvc.UI" />
      
    
    <httpmodules>
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
      <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
      <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
    
    <globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="en-US" />
  

What I have tried:

I don't know the reason why it is happening

使用:





use this:


<configuration>
  <system.web>
     <sessionState timeout="20"></sessionState>
  </system.web>
</configuration>







其中Timeout指的是时间..你可以甚至使用Cookie身份验证




where Timeout refers to the time .. You can even use Cookie Authentication for this