Session Expires very quickly

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hamayun Khan
    New Member
    • Aug 2007
    • 106

    Session Expires very quickly

    Hi all

    I have developed Website in asp.net. The site was working fine for more than 6 months. Now from 3 to 4 days I m facing a problem. When I login as Admin to Administrator and create Session for the administrator. The Session expires in less than a minute. I don't know why i m facing this problem. I m sure that I did nothing to code that cause this problem.

    Any Help in this issue.

    Thanks in Advance.
  • kunal pawar
    Contributor
    • Oct 2007
    • 297

    #2
    check your we.config file

    Comment

    • Hamayun Khan
      New Member
      • Aug 2007
      • 106

      #3
      Thanks for ur quick reply

      I did nothing for sessiontimeout in web.config file. I want the session to keep live for only 20 minutes.

      Comment

      • kunal pawar
        Contributor
        • Oct 2007
        • 297

        #4
        But there is setting related to session time out in web.config

        Comment

        • Hamayun Khan
          New Member
          • Aug 2007
          • 106

          #5
          Please look into my web.config file.
          Code:
          <?xml version="1.0"?>
          <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
            <configSections>
              <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
                <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
                  <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
                  <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
                  </sectionGroup>
                </sectionGroup>
              </sectionGroup>
              <section name="rewriter" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>
            </configSections>
          
            <connectionStrings>
              <add name="dbase_DataConnectionString6" connectionString="Data Source=tcp:xxxxx;Initial Catalog=xxxx;User ID=xxx;Password=xxx;Connection Timeout=120;" providerName="System.Data.SqlClient"/>    
            </connectionStrings>
          	<system.web>
              <pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode ="Never" >
                <controls>
                  <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
                  <add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
                </controls>
              </pages>
              <customErrors defaultRedirect="~/ErrorInfo.aspx"/>
              <httpHandlers>
                <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
                <remove verb="*" path="*.asmx"/>
                <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
                <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
                <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
              </httpHandlers>
              <authentication mode="Windows"/>
              <httpModules>
                <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter"/>
                <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
              </httpModules>
              <compilation debug="true">
                <buildProviders>
                  <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                </buildProviders>
                <assemblies>
                  <add assembly="Accessibility, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="Microsoft.SqlServer.ConnectionInfo, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
                  <add assembly="Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
                  <add assembly="Microsoft.SqlServer.SmoEnum, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
                  <add assembly="Microsoft.SqlServer.SqlEnum, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
                  <add assembly="Microsoft.Vsa.Vb.CodeDOMProcessor, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                  <add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                  <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                  <add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                  <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                  <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                  <add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                </assemblies>
              </compilation>
            </system.web>
            <system.web.extensions>
              <scripting>
                <webServices>       
                </webServices>      
              </scripting>
            </system.web.extensions>
            <system.webServer>
              <validation validateIntegratedModeConfiguration="false"/>
              <modules>
                <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
              </modules>
              <handlers>
                <remove name="WebServiceHandlerFactory-Integrated"/>
                <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
                <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
                <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
              </handlers>
            </system.webServer>
          
          	<rewriter>
          
              <rewrite url="home/(.+)" to="~/$1.aspx"/>
              
            </rewriter>
          </configuration>
          Last edited by Frinavale; Mar 20 '09, 03:31 PM. Reason: Added [code] tags. Please post code in [code] [/code] tags.

          Comment

          • Hamayun Khan
            New Member
            • Aug 2007
            • 106

            #6
            Also The Site is working fine locally when I run it from visual Studio

            Comment

            • Hamayun Khan
              New Member
              • Aug 2007
              • 106

              #7
              Originally posted by kunal pawar
              But there is setting related to session time out in web.config
              I add the following to web.config file.

              <sessionState cookieless="Use Cookies" timeout="60"> </sessionState>

              Before I add this line session expires within minute. Now session remain live for 4 to five minutes when I leave the page inactive.

              Comment

              • bhupinder
                New Member
                • Feb 2009
                • 32

                #8
                Originally posted by Hamayun Khan
                I add the following to web.config file.

                <sessionState cookieless="Use Cookies" timeout="60"> </sessionState>

                Before I add this line session expires within minute. Now session remain live for 4 to five minutes when I leave the page inactive.


                <sessionState cookieless="Use Cookies" timeout="180"> </sessionState>

                Comment

                • Frinavale
                  Recognized Expert Expert
                  • Oct 2006
                  • 9749

                  #9
                  Sometimes Cookieless Sessions are not acceptable, especially in websites that require authentication. ...like this case.

                  My assumption would be that your worker process is getting recycled because it is growing too large.

                  If this is the case, then not only will the administrator's session expire, all users using the system will have their sessions expire at the same time.

                  Make sure that all processes that use resources (like database connections, files access, etc) are cleaned up when they are no longer being used....especia lly with regards to administrator features.

                  -Frinny

                  Comment

                  Working...