System.Net.CookieException--..超过了配置的最大大小';4096';

本文关键字:4096 CookieException-- Net 过了 配置 System | 更新日期: 2023-09-27 18:20:57

我正在使用一个带有自定义安全框架的自定义.Net应用程序。除其他外,该框架还允许用户身份验证无缝传递到SQLServerReportingServices,以便访问查看器中的报告。然而,对于某些用户,我得到了以下错误:

2013-07-03 11:43:00580默认值。Page_Load(:0)-已初始化ReportServer Url:'https://www.DOMAIN.com/ReportServer2013年07月03日11:43:00696 ReportNavigation.LoadReportCatalog(:0)-发生错误从Web服务访问报表目录异常:System.Net.CookieException消息:cookie的值大小为'.ActionSecurity=AAEAAAD___AQAAAAAAAAAMAgAAAE1TeXN0ZW0uV2ViLCBWZXJzaW9uPTQuMC4wLjAsIEN1bHR1cmU9bV1dHJhbCwgUHVibGljS2V5VG9rZW49YjAzZjVmN2YxMWQ1MGEzYQUBAAAALVN5c3RlbS5XZWIuU2VjdXJpdHkuRm9ybXNBdXRoZW50aWNhdGlvblRpY2tldAkAAAAIX1ZlcnNpb24FX05hbWU LX0V4cGlyYXRpb24KX0lz3VlRGF0ZQ1fSXNQZXJzaXN0ZW50CV9Vc2VyRGF0YtfQ29va2lUGF0aBfSW50ZXJuYWZXJzaW9uDV9JbnRlcm5hbERhdGEAAQAAAAEBAAACIDQ0BCAIAAAQAAAAYDAAAADy5BY3Rpb25TZWN1cml0eQC1nPALRtBIAHnk1vdF0IgBBgQAAAC4GEFBRUFBQURfX19fX0FRQUFBQUFBQUTUFnQUFBRTlEWVdsMGFHNWxjM05OVFM1WFpXSXVVMlZqZFhKcGRIa3NJlpsY25OcGIyNDlNUzR3TGpBdU1Dd2dRM1ZzZEhWeVpUMXVaWFYwY21Gc0xDQlFkV0pzYVdOTFpYbViMnRsYmoxdWRXe HNEQU1BQUFCTlUzbHpkR1Z0TGxkbFlpd2dWbVZ5YzJsdmJqMDBMakF1TUM00xDQkRkV3gwZFhKbFBXNWxkWFJ5WVd3c0lGQjFZbXhwWTB0bGVWUnZhMlZ1UFdJd00yWTFaamRtTVRa05UQmhNMkVGQVFBQUFEQkRZV2wYUc1bGMzTk5UUzVYWldJdVUyVmpkWEpwZEhrdVFXTjBhVzl1VTJWamRYSnBkSGxRY21sdVkybHdZV3dJQUFBQUNWOXBaR1Z1ZEdsMGVRaGZkbVZ5YzJsdmJndGZaWGh3YVhKbFjHRjBaUXBmYVhOemRXVkVZWFJsRFY5d2NtTJhV1JsY2s1aGJXVUpYM1Z6WlhKT1lXMWxFMTlwYzBGamRH bHZia…"。这超出了配置的最大大小"4096"。来源:System at System.Net.CookieContainer.Add(Cookie Cookie,布尔值throwOnError),位于System.Net.CookieContainer.Add(Cookiecookie)
位于APPNAMEMM.Reporting.WebServiceClient.ReportServerProxy.GetCookies()在里面D: ''APPNAME''Code''Core''APPNAMEMM.Reporting.WebServiceClient''ReportServerProxy.cs:line131 atAPPNAMEMM.Reporting.WebServiceClient.ReportServerProxy.GetWebRequest(Uriuri)D: ''APPNAME''Code''Core''APPNAMEMM.Reporting.WebServiceClient''ReportServerProxy.cs:line71 atSystem.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(字符串methodName,Object[]参数)APPNAMEMM.Reporting.WebServiceClient.ReportiingService2005.ListChildren(字符串项,布尔递归)D: ''APPNAME''Code''Core''APPNAMEMM.Reporting.WebServiceClient''WebReferences''ReportingService''Reference.cs:line 871APPNAMEMM.Reporting.WebServiceClient.ReportCatalogService.GetCatalogItemList(字符串路径)D: ''APPNAME''Code''Core''APPNAMEMM.Reporting.WebServiceClient''ReportCatalogService.cs:line162 atAPPNAMEMM.Reporting.WebServiceClient.ReportCatalogService.GetReportList(字符串路径,布尔showHidden,字符串子文件夹)D: ''APPNAME''Code''Core''APPNAMEMM.Reporting.WebServiceClient''ReportCatalogService.cs:line116APPNAMEMM.Reporting.WebServiceClient.ReportCatalogService.GetReportList(字符串路径,布尔showHidden)D: ''APPNAME''Code''Core''APPNAMEMM.Reporting.WebServiceClient''ReportCatalogService.cs:line108APPNAMEMM.Reporting.WebServiceClient.ReportCatalogService.GetReportList(字符串路径)D: ''APPNAME''Code''Core''APPNAMEMM.Reporting.WebServiceClient''ReportCatalogService.cs:line81在ReportNavigation.LoadReportCatalog()

2013-07-03 11:43:00749 ASP.global_asax.Application_Error(:0)-安发生了意外错误。(URL:/Income Reports/Default.aspx
表单字段:异常:System.Configuration.Provider.ProviderException消息:无法检索此操作的当前HttpContext。来源:APPNAMEMM.Web.Security位于中的APPNAMEMM.Web.Security.ActionSecurity.DeleteCookie()D: ''APPNAME''Code''Core''APPNAMEMM.Web.Security''ActionSecurityProvider''ActionSecurity.cs:line265,位于APPNAMEMM.Web.Security.ActionSecurityModule.OnLeave(对象发件人,中的EventArgs e)D: ''APPNAME''Code''Core''APPNAMEMM.Web.Security''ActionSecurityProvider''ActionSecurityModule.cs:line192位于System.Web.HttpApplication.RiseOnPreSendRequestHeaders()

我已经尝试根据一些建议更改应用程序中的web.config以及ReportServer和ReportManager文件夹,这些建议包括http://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits和http://bartwullems.blogspot.com/2010/04/uploading-large-files-in-iis-7.html

但是,我仍然收到错误消息,用户无法访问报告。我还有什么需要做的吗?谢谢

System.Net.CookieException--..超过了配置的最大大小';4096';

  1. 两个都是你设定的吗?http://forums.iis.net/t/1169846.aspx

  2. 但是,您得到的是CookieException,而不是最大请求限制异常。以上设置与cookie无关。它们指的是上传到服务器的文件。

  3. 看起来你是在试图把4K以上的内容塞进饼干里。如果是这样,你就不能。。这是系统限制网络浏览器的最大大小是多少';s cookie';s键。。事实上,你的里程数可能因浏览器而异,但如果你在cookie中设置超过4K,你可能需要改变策略,比如切换到会话。

  4. 对N°3表示同意?你可以在这里更正错误。。但你仍然可能遇到问题N°3:-)

取自您自己的堆叠式This exceeds the configured maximum size, which is '4096' ... at System.Net.CookieContainer.Add(Cookie cookie) ... ReportServerProxy.cs:line 131


var container = new System.Net.CookieContainer {
    MaxCookieSize = 8192
};
container.Add(new System.Net.Cookie {
    Value = "somehugevalue"
});

CookieStore受到限制时,可以使用localStorage

代码示例:

localStorage.setItem('ActionSecurity', '[largevalue]');
localStorage.getItem('ActionSecurity');

参考W3C chools