C#.NET How to set session time out to 6 hours with forms authentication

asp.netcsession-timeout

In my application I use Forms Authentication and sessions. How do I take care that the user is logged out after a period of 6 hours?

In my web.config I set the sessions time-out to 360 minutes. But after a period of 10 minutes of inactivity I have to login again.

I also set my forms authentication timeout to 360 minutes. What is it I am doing wrong?

Best Answer

There are some other timeout values that will affect session time out. One of them that comes to my mind is Worker Process Timeout(that is set from IIS). Worker Process's default time out is 20 mins, so if there is no activity in your site for 20 mins the worker process will end and causing your session to end if you are using session in InProc mode. So getting Worker Process's timeout value to 360 minutes is what you may need as well.