I have problem with session timeout even i added code in web.config as follows but its not working, it expires within 10 mins.
<sessionState mode="InProc" timeout="300"></sessionState>
Server has session timeout of 20 mins.
Please help me to solve session timeout issue?
What is the idle timeout set to on the IIS Application Pool being used by your app? Since you are using InProc session, if the pool process terminates, session will be lost as well.
Despite your Server has session timeout of 20 minutes as you mentioned. you may lost session state data for the following reason:
- When IIS Application Pool restarts or reset.
- ASP.NET Worker Process is recycled unexpectedly.
- Overriding your bin or web.config.
- Or when you upload or delete any file in the application.
Solution: use StateServer session state mode:
<sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" cookieless="UseCookies" timeout="300" regenerateExpiredSessionId="true" />
visit this link to configure StateServer: Configure a State Server to Maintain Session State
Maybe cookies is turned off in your browser or it setted not to domain but for some folder or subdomain. Test this session with following way
<sessionState cookieless="true" mode="InProc" timeout="300" > </sessionState>
If It will work then problem is with your browser 1) cookies is turned off OR 2)some request will make session value to null.
Update
If this is issue with chrome then it will request favicon.ico (in my case)see here my updated question for that.
Check your application pool idle timeout it defaults to 20 min (if app pool is idle for 20 min it'll recycle and all in-Proc sessions will be cleared) increase its timeout