ASPXAUTH Cookie未保存 [英] ASPXAUTH cookie is not being saved

查看:319
本文介绍了ASPXAUTH Cookie未保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ASP .NET MVC 2中的一个web项目上工作。



在这个项目中,我们将一些信息存储在一个ecripted cookie(ASPXAUTH cookie)需要查询db的每个请求。



事情是这个部分的代码突然停止工作。



我审查了对源代码控制服务器上的代码所做的任何可能导致它的任何东西,我什么也找不到。我甚至还原到一个已知的工作副本(工作在其他人的PC,相同的代码等),但调试后,似乎.ASPXAUTH cookie不再被保存。而是ASP.NET_SessionId cookie正在设置...(之前不是)



我更改了web.config文件关闭sessionState。这消除了ASP.NET_SessionId cookie的设置,但它仍然不保存auth cookie。



Ive最近安装了一些Microsoft Windows XP更新,但另一个人



谷歌搜索后,我发现一些信息指出cookie的过期日期有问题。以太网cus的pc没有正确的时间/日期(这不是这种情况)和其他cus的cookie过期日期被错误设置。 (我检查,它正在设置正确)...



除了一个使用(Chrome)之外,其他浏览器的问题仍然存在我尝试了IE6。 p>

有任何想法为什么会发生?



我会继续发布任何有用的信息。 >

提前感谢。

解决方案

这可能是因为您的Cookie太大。我碰到了同样的问题。
如果你的cookie变得太大,它只是不工作,这取决于浏览器当然



MSDN



Cookie通常限制为4096字节,您每个网站不能存储超过20个Cookie。通过使用带有子项的单个Cookie,您可以使用更少的网站分配的20个Cookie。此外,单个Cookie占用大约50个字符的开销(过期信息等),加上其中存储的值的长度,所有这些都计入4096字节的限制。如果您存储五个子项而不是五个单独的Cookie,则可节省单独的Cookie的开销,并可节省大约200个字节。



Web浏览器的Cookie密钥的最大大小是多少?



Cookie档案超过最大尺寸?


Im working on a web project in ASP .NET MVC 2.

In this project we store some info inside an ecripted cookie (the ASPXAUTH cookie) to avoid the need to query the db for every request.

The thing is the code for this part has suddenly stopped working.

I reviewed the changes made to the code on the source control server for anything that could be causing it, I found nothing. I even reverted to a known working copy (working on some other persons PC, same code, etc) but after debugging, it seems the .ASPXAUTH cookie is not getting saved anymore. Instead the ASP.NET_SessionId cookie is being set... (wich before wasn't)

I changed the web.config file to turn off the sessionState. This eliminated the ASP.NET_SessionId cookie from being set, but it is still not saving the auth cookie.

Ive recently installed some Microsoft Windows XP Updates, but the other person (whos PC runs the application just fine) also did.

After googling, some info i found pointed out to a problem with the expiration date of the cookie. Ether cus the pc didnt have the right time/date (this was not the case) and others cus of the cookie expiration date being wrongly set. (I checked and it is being set correctly)...

The problem persists with other browsers besides the one im using (Chrome) i tried it with IE6.

Any ideas on why this is happening?

Ill continue to post any helpful information i can find.

Thanks in advance.

解决方案

This could be that your cookie grew too big. I ran into the same issue. If your cookie becomes too big, it just won't work, depending on the browser of course

MSDN

cookies are usually limited to 4096 bytes and you can't store more than 20 cookies per site. By using a single cookie with subkeys, you use fewer of those 20 cookies that your site is allotted. In addition, a single cookie takes up about 50 characters for overhead (expiration information, and so on), plus the length of the value that you store in it, all of which counts toward the 4096-byte limit. If you store five subkeys instead of five separate cookies, you save the overhead of the separate cookies and can save around 200 bytes.

What is the maximum size of a web browser's cookie's key?

what happens when cookies file exceeds maximum size?

这篇关于ASPXAUTH Cookie未保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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