Last post Oct 10, 2016 10:20 AM by Siva Krishna Macha
Oct 06, 2016 10:40 AM|danishdotnet|LINK
My asp.net web application session automatically expired in unexpected time on live server what is the problem?
Oct 06, 2016 11:52 AM|Siva Krishna Macha|LINK
There could be many reasons for it.
One of the reasons could be if there is any restart in IIS or appPool recycle (could be due to a web.config change or so) on the server.
This article explains the list of common causes:
Oct 06, 2016 12:25 PM|danishdotnet|LINK
sir how we can change IIS or appPool recycle setting on live server please tell me sir I am new in asp.net.
Oct 06, 2016 02:24 PM|Siva Krishna Macha|LINK
App pool get recycled only when the changes happens or some unexpected things happen on server (causes can vary - hope you read the blog).
So first we need to figure ask few questions to ourselves to find out the root cause of the problem:
when did the session expire?
Is it happening frequently (or) just happened once for one user?
If it is happened only once for a user - what is the timestamp of the error occured? - With the timestamp we can look for any event logs in the server to see what happened during that time.
If it is happening frequently - what is the time that the user is getting logged out? In general, 20 minutes idle time would be the session timeout as defined in the web.config file - If the user session expired after 20 minutes of idle time (assuming slidingExpiration
setting), then, it is usual behaviour and not an issue.
Hope this helps. Let me know for any questions on these.
Oct 07, 2016 04:31 AM|danishdotnet|LINK
sir when user left application idle for 5 min it will logout automatically otherwise I have check for 1.5 hour on continue using it works fine. It is happening frequently.
Oct 07, 2016 07:36 AM|Chris Zhao|LINK
Make sure idle timeout of the Application Pool is longer than the .NET session timeout. Idle Timeout is if no action has been asked from your web app, the process will drop and release everything from memory.
Oct 07, 2016 09:31 AM|Siva Krishna Macha|LINK
In addition to app pool recycle that we discussed earlier, Make sure the session timeout is also set correctly in web.config (in case if you have overwritten it).
In the setting above, timeout="30" means, 30 minutes.
Hope in your config file, it is not set to 5.
Reference for timeout: https://msdn.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate.timeout(v=vs.110).aspx
Oct 08, 2016 09:24 AM|danishdotnet|LINK
Can anyone help me for this problem I am in a big problem by this condition. My web application automatically logout after 5 -6 min.
This is also not working.
<sessionState timeout="6000" />
This is also not working. what can I do????????
Oct 10, 2016 10:20 AM|Siva Krishna Macha|LINK
If your application is deployed in the Server - check with server team who is maintaining it..
to see if they have overwritten these values in their root web.config or machine.config files. Ignore my comment above (striked out) - web.config will have higher importance and will overwrite the settings if
you have explicitly mentioned the settings in your config.
You can still check with server team to see the Event Logs in the server to see if the application is getting recycled during that interval.
To open the event logs - you can click Windows button + R (i.e., open run command) - Type eventvwr and press enter - That would open the GUI to see event logs.
I would also check the Idle time out setting of AppPool. (Chris has put the screenshot as well in the post above).
For complete steps:
1. Open IIS, Locate your site.
2. Check Advanced settings to findout the application pool.
3. Click on Application pools in the left hand pane and then you can see list of application pools on the center pane. Select your application pool. Go to Advanced settings in the right hand pane. This is where you can see the idle timeout setting (named
as `Idle Time-out (minutes)`) and you can change it, if it is 5 over there.