Search code examples
asp.netreporting-servicesreportviewer

ASP.NET ReportViewer error "ASP.NET session has expired or could not be found"


My organization has an ASP.NET application which is a wrapper for our SSRS reports. This app essentially just gives users a series of dropdown menus to navigate to their reports rather than making users navigate to reports via the default SSRS report manager pages.

In this application we have had users experiencing errors, specifically an error: "ASP.NET session has expired or could not be found". This was happening to users after attempting to change a report parameter and re-running the report, after only a few minutes of viewing reports.

I have attempted to use KeepSessionAlive="true"` within my ReportViewer control in combination with extending the Session Timeout value in our web.config. Neither of those things did the trick to resolve this error.


Solution

  • As per the msdn article on Session-State modes available at: https://msdn.microsoft.com/en-us/library/ms178586.aspx

    We ended up switching this from the default InProc mode to StateServer mode and haven't been able to reproduce the error since. Using StateServer mode had an extra hoop to jump through though, in that we had to enable the ASP.NET State Service on our server, set it to Automatic Startup type and then update our web.config sessionState value from:

    <sessionState timeout="120"/>
    

    to:

    <sessionState mode="StateServer" stateConnectionString="tcpip=localhost:42424" timeout="120"/>