I have a SharePoint site. We have some web parts rendering ascx controls.
Session time out and IIS idle time out is set to 2 hours (120 mins) in web config and iis settings. I have confirmed that session does not time out After 30 minutes of idle time the drop downs and check box list in application becomes empty I had Visual studio debugger attached to my application and had the application idle for 30 minutes to see what is happening. After 30 mins when I try to post back, I watched variables in the debugger. I found the session variables were alive and had values. However the drop down and ViewState variables were empty.
We are using SQL server sessions. I am clueless and have spent nights on this issue but seem to get no where.
So the answer is in the Part 2 of the article that Nicholas posted. Turns out that web application has a setting that can be controlled through Powershell
$web = Get-SPWebApplication "http://mywebapp..." $web.FormDigestSettings.TimeOut
This is by default 30 minutes and SharePoint Viewstate cache is cleared after FormDigestSettings.TimeOut +1 (i.e. 31 minutes)
$web.FormDigestSettings.TimeOut = New-TimeSpan -Hours 1 -Minutes 0
Increasing this time out might have some performance implications hence encourage you to read the article .
http://blogs.msdn.com/b/besidethepoint/archive/2013/03/27/appfabric-caching-and-sharepoint-2.aspx