ASP.NET 会话已过期

ASP.NET session expired

我看到我的错误日志中记录了一个异常,它是 Microsoft.Reporting.WebForms.AspNetSessionExpiredExceptionAsp.net

但我无法重现它。在进行 google 搜索后,我了解到这是因为会话过期。

我的问题是,这个错误的某些原因是什么?有什么方法可以通过手动清除会话来重现它?

错误日志:

15/12/2015 09:08:11Microsoft.Reporting.WebForms.AspNetSessionExpiredException: ASP.NET session has expired or could not be found at Microsoft.Reporting.WebForms.ViewerDataOperation..ctor() at Microsoft.Reporting.WebForms.ReportDataOperation..ctor(Boolean requiresFullReportLoad) at Microsoft.Reporting.WebForms.HttpHandler.GetHandler(String operationType) at Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) at Microsoft.Reporting.WebForms.ViewerDataOperation..ctor() at Microsoft.Reporting.WebForms.ReportDataOperation..ctor(Boolean requiresFullReportLoad) at Microsoft.Reporting.WebForms.HttpHandler.GetHandler(String operationType) at Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

您可以在您的 webconfig 中设置会话超时值,这是您可以检查它的方式

<configuration>
  <system.web>
     <sessionState timeout="20"></sessionState>
  </system.web>
</configuration>