2012-05-11 2 views
1

프로젝트에 대한 코드를 조사하고 구현했지만 20 분 후에도 세션이 로그 아웃되고 로그인 페이지로 돌아갑니다. 시간 제한을 httpruntime 또는 sessionstate 또는 global.asax에 추가하거나 IIS 응용 프로그램 풀에서 Idle Timeout을 늘리더라도 문제가 해결되지 않습니다.asp.net에서 "20"분 후에 세션이 로그 아웃하면 어떻게해야합니까?

의 Web.config :

<authentication mode="Forms"> 
     <forms name="__authcookie" loginUrl="LoginPage.aspx" timeout="60" protection="All" requireSSL="false" slidingExpiration="true" cookieless="UseDeviceProfile" enableCrossAppRedirects="false"/> 
    </authentication> 
    <sessionState mode="InProc" timeout="60" customProvider="AppFabricCacheSessionStoreProvider"></sessionState> 
<membership> 
    <providers> 
    <clear /> 
    <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" /> 
    </providers> 
</membership> 
<profile> 
    <providers> 
    <clear /> 
    <add name="AppFabricCacheSessionStoreProvider" type="Microsoft.ApplicationServer.Caching.DataCacheSessionStoreProvider" cacheName="NamedCache1" sharedId="SharedApp"/> 
    <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" /> 
    </providers> 
</profile> 

Global.asax에 :

void Session_Start(object sender, EventArgs e) 
     { 
      // Code that runs when a new session is started 
      Session.Timeout = 60; 
     } 

답변

1

에 한번 당신의 web.config 파일 당신이 세션을 원하지 않는 경우에도

<system.web> 
    <authentication mode="Forms"> 
      <forms timeout="50"/> 
    </authentication> 
    <sessionState timeout="60" /> 
</system.web> 

이 추가 시간이 초과되면이 기사를 읽는 것이 좋습니다. Avoid Prevent Session TimeOut In Asp.Net To Keep Alive

0

타임 아웃 세션이 아니라 인증 일 수 있습니다. 인증은 <authentication> 요소 (기본적으로 .ASPXAUTH 쿠키)를 사용하여 제어되며 이는 세션과 다릅니다 (기본적으로 Aspnet_SessionId 쿠키).

<authentication> 요소의 timeout 속성을 사용하십시오.

관련 문제