Click here to Skip to main content
14,665,497 members
Rate this:
Please Sign up or sign in to vote.
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
   <compilation debug="true" targetFramework="4.0"/>
   <httpRuntime maxRequestLength="1600000" executionTimeout="300"/>
   <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
       <add tagPrefix="obout" namespace="Obout.Grid" assembly="obout_Grid_NET"/>
       <add tagPrefix="obout" namespace="Obout.Interface" assembly="obout_Interface"/>

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

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

<sessionstate timeout="20">
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.
Beginner Luck 13-Jul-16 2:27am
Under system.web section try following-
Suvendu Shekhar Giri 13-Jul-16 2:35am
Under system.web section try following-
<sessionstate timeout="20" .....
Member 12097108 13-Jul-16 2:37am
Actually sir I was sended code of my webconfig file.only this one code I have in config file.I try every code which I can get form Google but the problem me remain same.If you have code for solving that can you please help for this.
Member 12097108 13-Jul-16 2:49am
I have already try it. still problem remain same.
Member 12097108 13-Jul-16 2:50am
I have already try it.still problem remain same.
F-ES Sitecore 13-Jul-16 5:05am
Session and authentication timeout are not the same thing, you seem to be getting the two confused which might be part of your problem, and when you use the two interchangeably it makes it hard to help.
Member 12097108 13-Jul-16 6:09am
I know that, i already try this with separate but still it will logout after 1 mintues.
ZurdoDev 13-Jul-16 14:21pm
You say, "if I wait 1 or 2 minutes the session will expire and goes to again login page." Are you being taken to the login page automatically? Without doing anything? Or does it happen after you click a button or navigate a link?
Member 12097108 14-Jul-16 1:22am
Not button clicking.actually sir,suppose I login to system now I click on page1.aspx and wait 1 or 2 minutes then after I load page2.aspx then it should go page2.aspx but in my case when I load page2 then automatically goes to login page .I have done every code and web config file as well as global.asax file bur problem remain same.
ZurdoDev 14-Jul-16 7:15am
How are you loading page2? Do you click a link?

Also, look in the event viewer to see if the app pool is restarting.
Member 12097108 14-Jul-16 7:48am

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100