Link to home
Create AccountLog in
Avatar of malikirfan28
malikirfan28

asked on

Session Timeout in ASP.Net 4.0

Hello Everyone!
I have configured SessionTimeout in my ASP.Net application to 60 minutes in Web.Config file using following configuration.
<sessionState mode="InProc" stateConnectionString="tcpip=localhost:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="60"/>

Open in new window


I have also set SessionTimeout in IIS to 60 minutes as expained here.

But I am observing very unstable session timeout behaviour, sometimes it occur after 20 minutes and sometimes after 20+ minutes.
Kindly suggest what I am doing wrong?
Avatar of Pratima
Pratima
Flag of India image

This might be memory issues.  Is your web site being accessed heavily?  If it does, you might want to try shifting mode from Inproc to State Server or SQL Server.

http://msdn.microsoft.com/en-us/library/ms178586.aspx
Avatar of malikirfan28
malikirfan28

ASKER

Pratima: The solution you provided is for IIS6/IIS5 but as I mentioned I am using IIS7.

Alfred:  No it is not havily accessed. Right now only two user are accessing the site and facing this session timeout issue.
Have you checked the application event log to determine why your session is dropping?  You might have some unhandled exception that is causing your web site session to crash.
ASKER CERTIFIED SOLUTION
Avatar of Pratima
Pratima
Flag of India image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Yes I have verified there is no detail in Event Log.