Reserved.ReportViewerWebControl.axd cookie accumulation

本文关键字:accumulation cookie axd ReportViewerWebControl Reserved | 更新日期: 2023-09-27 18:13:21

我在使用Microsoft ReportViewer时遇到问题。每个新生成的报告都添加了一个新的cookie,如下所示:/Reserved.ReportViewerWebControl.axd%3FOpType%3DSessionKeepAlive%26ControlID%3Df6166329be5f4b00aa32320285ffaf55_SKA直到服务器由于请求中的cookie太多而导致CCD_ 2错误而开始故障。我曾尝试手动使这些cookie过期,但没有成功。我的报表查看器初始化代码:

var credentials = new ReportViewerCredentials { NetworkCredentials = System.Net.CredentialCache.DefaultCredentials};            
           mainReportViewer.ServerReport.ReportServerCredentials = credentials;
           mainReportViewer.ProcessingMode = ProcessingMode.Remote;
           mainReportViewer.ReportError += OnReportError;
           mainReportViewer.ShowRefreshButton = false;
           mainReportViewer.ShowWaitControlCancelLink = false;
           mainReportViewer.ShowBackButton = false;
           mainReportViewer.ShowCredentialPrompts = false;
           mainReportViewer.AsyncRendering = true;
           mainReportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportServerUrl"]);
           ExtractReportParametersFromCookie(mainReportViewer);
           mainReportViewer.ServerReport.Refresh();

Web.Config:

<system.web>
      <httpHandlers>
        <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" validate="false" />
      </httpHandlers>
      <compilation debug="true" targetFramework="4.5">
        <assemblies>
          <add assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
          <add assembly="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
          <add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        </assemblies>
        <buildProviders>
          <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
        </buildProviders>
      </compilation>
   </system.web>
   <system.webServer>
      <handlers>
         <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*"  path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
      </handlers>
   </system.webServer>

也许有人有办法解决这个问题?

Reserved.ReportViewerWebControl.axd cookie accumulation

似乎KeepSessionAlive="False"解决了这个问题,可以用作解决方法。