Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone.
I have live web application(c#).if I am login into system and load the one page now if I wait 1 or 2 minutes the session will expire and goes to again login page.
Actually the problem is very simple but i try everything which i can saw on Google but i didn't get solution for this. I hope any one help me for that.
this is my web config file
XML
<system.web>
   <compilation debug="true" targetFramework="4.0"/>
   <httpRuntime maxRequestLength="1600000" executionTimeout="300"/>
   <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
     <controls>
       <add tagPrefix="obout" namespace="Obout.Grid" assembly="obout_Grid_NET"/>
       <add tagPrefix="obout" namespace="Obout.Interface" assembly="obout_Interface"/>
     </controls>
   </pages>
 </system.web>

XML
<system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="Session"/>
      <add name="Session" type="System.Web.SessionState.SessionStateModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </modules>
    <defaultDocument enabled="true">
      <files>
        <clear/>
        <add value="Login.aspx"/>
      </files>
    </defaultDocument>
  </system.webServer>


Only this kind of coding in my web config.

What I have tried:

I try
<authentication mode="Forms">
<forms timeout="20"/>
<sessionstate mode="InProc" cookieless="true" timeout="60">

also this kind of coding..
<system.web>

<sessionstate timeout="20">
Posted
Comments
Suvendu Shekhar Giri 13-Jul-16 2:09am    
not clear. do you want to increase the session timeout?
Member 12097108 13-Jul-16 2:13am    
yes,I try every code which I can get from Google and which I can put on web config file like <session timeout="20"> and like <authication>....
but the problem is remain same If i dont do anything for 1 minutes my session will expired and ask to again login.
Suvendu Shekhar Giri 13-Jul-16 2:35am    
Under system.web section try following-
<sessionstate timeout="20" .....
Member 12097108 13-Jul-16 2:49am    
I have already try it. still problem remain same.
Beginner Luck 13-Jul-16 2:27am    
Under system.web section try following-

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900