2014-12-09 70 views
0

最近我遇到了會話超時的問題。用戶可以成功登錄,但在操作過程中只需幾頁,會話將在幾分鐘內超時(< 4分鐘)。 最近,當我在新服務器上移動我的應用程序時,就是爲此而開始的。在此之前,我的Web應用程序工作正常。 請幫幫我。 我webConfig設置像顯示會話在幾分鐘內過期

<configuration> 
<configsections> 
    <sectiongroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> 
     <sectiongroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> 
     <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirepermission="false" allowdefinition="MachineToApplication" /> 
     <sectiongroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> 
      <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirepermission="false" allowdefinition="Everywhere" /> 
      <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirepermission="false" allowdefinition="MachineToApplication" /> 
      <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirepermission="false" allowdefinition="MachineToApplication" /> 
      <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirepermission="false" allowdefinition="MachineToApplication" /> 
      </sectiongroup> 
     </sectiongroup> 
    </sectiongroup> 
    </configsections> 
    <appsettings> 
    <add key="CrystalImageCleaner-AutoStart" value="true" /> 
    <add key="CrystalImageCleaner-Sleep" value="60000" /> 
    <add key="CrystalImageCleaner-Age" value="120000" /> 
    </appsettings> 
    <connectionstrings> 
    <add name="ConnectionString1" connectionstring="Data Source=xx.xx.xx.xx;Initial Catalog=xxxx;User ID=xxxx;Password=xxxx;" providername="System.Data.SqlClient" /> 
    </connectionstrings> 


     <system.web> 
+0

粘貼您的會話狀態配置設置。在這裏看不到它 – 2014-12-09 12:10:10

+0

那個小的web.config文件你有 – Mivaweb 2014-12-09 12:10:17

回答

0

這裏是設置超時會話的代碼。如果您未使用狀態服務r(模式:InProc),那麼當更改web.config或清除瀏覽緩存(對於Firefox)時,會話將被清除,並且還查看配置設置。

<configuration> 
    <system.web> 
    <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" 
     sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" 
     cookieless="false" timeout="20" /> 
    </system.web> 
</configuration> 
+0

非常感謝你:) – 2015-01-15 09:16:56