请求的 ASP.NET 表单身份验证失败。原因:提供的票已过期
我在事件日志中多次收到此错误,并且用户已注销。
活动代码:4005
事件消息:请求的表单身份验证失败。原因:提供的票已过期。
活动时间:2011年3月10日下午3:35:22
活动时间(UTC):2011年3月10日 8:35:22 PM
事件 ID:fc2f70cc85014b0ca7dbb01471617b66
事件序列:3392
事件发生:1
活动详情代码:50202
想法:
- 我没有使用网络表单。
- 我不认为应用程序池正在回收。
- 我比较了几个事件中的进程ID,它是相等的。
- 我的机器密钥不是自动生成的。
I am getting this error many times in the event log and users are logged out.
Event code: 4005
Event message: Forms authentication failed for the request. Reason: The ticket supplied has expired.
Event time: 3/10/2011 3:35:22 PM
Event time (UTC): 3/10/2011 8:35:22 PM
Event ID: fc2f70cc85014b0ca7dbb01471617b66
Event sequence: 3392
Event occurrence: 1
Event detail code: 50202
Thoughts:
- I am not using web forms.
- I do not think the app pool is recycling.
- I compared the Process ID in several events and it is equal.
- My machine key is not AutoGenerate.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
听起来像是当您的表单身份验证票证过期时您会收到的错误。您的票证的超时期限是多长?是设置为滑动过期还是绝对过期?
我相信默认的超时时间是 20 分钟,并且可以滑动过期,因此如果用户通过身份验证并且在某个时间点在 20 分钟内没有访问您的网站,那么他们的票证就会过期。如果设置为绝对过期,它将在发出后 X 分钟过期,其中 X 是您的超时设置。
您可以在
/configuration/system.web/authentication/forms
下的web/machine.config
中设置超时和过期策略(例如滑动、绝对)Sounds like an error you would get when your forms authentication ticket has expired. What is the timeout period for your ticket? Is it set to sliding or absolute expiration?
I believe the default for the timeout is 20 minutes with sliding expiration so if a user gets authenticated and at some point doesn't hit your site for 20 minutes their ticket would be expired. If it is set to absolute expiration it will expire X number of minutes after it was issued where X is your timeout setting.
You can set the timeout and expiration policy (e.g. sliding, absolute) in your
web/machine.config
under/configuration/system.web/authentication/forms
我遇到了同样的错误,在我们的例子中,它是由负载平衡器引起的。我们必须确保持久性设置为源 IP。否则,登录表单由一台服务器打开,并由另一台服务器处理,这将无法正确设置身份验证 cookie。也许这对其他人有帮助
I was getting this same error, in our case it was caused by a load balancer. We hade to make sure that the persistance was set to Source IP. Otherwise the login form was opened by one server, and processed by the other, which would fail to set the authentication cookie correctly. Maybe this helps someone else
这是 Microsoft http://www.iis 的一篇好文章。 net/learn/troubleshoot/security-issues/troubleshooting-forms-authentication 涵盖各种案例和场景。
Here is a good article from Microsoft http://www.iis.net/learn/troubleshoot/security-issues/troubleshooting-forms-authentication that covers various cases and scenarios.
使用另一台机器上的 web.config 后我遇到了同样的问题。该问题与无效的
MachineKey
有关。为了解决这个问题,我修改了 web.config 以使用服务器的正确MachineKey
。此 MSDN 博客文章 展示了如何生成 MachineKey。
I've had the same issue after using a web.config from another machine. The problem was related with an invalid
MachineKey
. To solve the problem, I modified the web.config to use the correctMachineKey
of my server.This MSDN blog post shows how to generate a MachineKey.
正如斯科特在这里提到的 http://weblogs.asp.net/scottgu/archive/2010/09/30/asp-net-security-fix-now-on-windows-update.aspx
Windows安装.net Framework的安全更新后,您会遇到这个问题。
只需修改 web.config 文件中的配置部分并切换到不同的 cookie 名称即可。
AS Scott mentioned here http://weblogs.asp.net/scottgu/archive/2010/09/30/asp-net-security-fix-now-on-windows-update.aspx
After windows installed security update for .net framework, you will meet this problem.
just modify the configuration section in your web.config file and switch to a different cookie name.