如何减小AspNet.ApplicationCookie的大小及其内容? [英] How can I reduce the size of AspNet.ApplicationCookie and what's in it?

查看:88
本文介绍了如何减小AspNet.ApplicationCookie的大小及其内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的生产环境中(仅),任何Admin帐户都极有可能收到"HTTP错误400.请求标头的大小太长".几乎可以根据任何请求.查看cookie,我发现AspNet.ApplicaitonCookie非常大,为15K.在我们的其他环境中,此Cookie约为1K.这是一个相当新的问题(已存在2年以上),而且我被告知前几天没有进行任何更改.

In our production environment (only) any Admin account has a good chance of receiving "HTTP Error 400. The size of the request headers is too long." on just about any request. Looking at the cookies I see that the AspNet.ApplicaitonCookie is huge, 15K. In our other environments this cookie is about 1K. This is a fairly new issue (been live over 2 years) and I'm told there were no changes made in the days prior.

此Cookie中包含什么? (除了身份验证内容"之外)

What is in this cookie? (aside from 'authentication stuff')

如何减小尺寸?

什么会导致产品如此不同?从理论上讲,它应该与分期相同,但显然不是.

What could cause prod to be so different? Theoretically it should be the same as staging but it's clearly not.

我希望修复"此Cookie,而不是更改大小限制.我总是更喜欢解决问题,而不是掩盖它.

I'd prefer to "fix" this cookie instead of changing the size limits. I always prefer fixing the issue instead of covering it up.

推荐答案

此Cookie中包含什么? (除了身份验证内容"之外)

What is in this cookie? (aside from 'authentication stuff')

所有用户身份资料.包括可能已通过自定义声明添加的所有内容.

All the user Identity stuff. Including anything that may have been put in via custom Claims.

如何减小尺寸?

What can I do to reduce it's size?

删除一些自定义声明.

什么可能导致产品如此不同?

What could cause prod to be so different?

数据!! Prod比Dev拥有更多的数据.

Data!! Prod has way more data than Dev.

因此,显然谁曾写过这幅特别的宝石,并不知道(或不在乎)索赔数据被塞入cookie并传递出去. 他们"列出了一份清单,该清单会随着时间的推移而增长.删除并解决.

So apparently who ever wrote this particular gem didn't know (or didn't care) that the claim data got stuffed into a cookie and passed around. 'They' put a list in there that will grow with time. Removed and solved.

这篇关于如何减小AspNet.ApplicationCookie的大小及其内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆