Session Expires within few 4 minutes

636 Views Asked by At

Recently i'm facing a problem of session timeout. User can logedin successfully but during his operation over few pages, Session times out within couple minutes(<4 mins). Most recently when I moved my application on a new server be the inception of this. Before this my Web Application was working fine. Please help me. My webConfig settings are like shown

<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>
1

There are 1 best solutions below

0
On

Here is the code to set the time out for the session. If you are not using state serve r(mode:InProc) then the session will get cleared when the web.config is changed or the browse cache is cleared(for firefox) and also Review the config settings also.

<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>