窗体身份验证超时,当它不应该? [英] Forms Authentication timing out when it shouldn't?

查看:109
本文介绍了窗体身份验证超时,当它不应该?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有被我逼疯的ASP.NET应用程序的问题。

I have a problem with an ASP.NET application that is driving me nuts.

当用户离开网页闲置一段时间的会议超时和错误都被抛出,由于会话变量不被解析(我将错误陷阱这个反正但这不是问题)。
我$ C $光盘defribulator,这将在会话超时的后半段进行一种无形的回发已经过期,这似乎做工精细 - 离开30分钟的应用程序并没有造成即使会话超时是20集的错误分钟。
然而,今天上午其他的离散事件之一,经历了超时 - ?这怎么可能。

When a user leaves a page inactive for a period of time the session was timing out and error were being thrown due to session variables not being resolvable (I will error trap this anyway but this is not the problem). I coded a 'defribulator' which will perform an invisible postback after half of the session timeout has expired and this seemed to work fine - leaving the application for 30 mins did not cause an error even though the session timeout was set for 20 mins. However, this morning one of the other Devs experienced a timeout - How is this possible?

在进一步的调查,我认为这超过了窗体身份验证超时时出现的问题 - 即使defribulator已经(显然)保持会话活着。我已阅读,如果指定的超时时间的一半elepsed后出现回传认证门票只补发,这可能不是问题,因为defrib将已发出超时期间下半年的请求 - 那么,为什么它不补发?

On further investigation I think that the problem occurs when the Forms Authentication timeout is exceeded - even though the defribulator has been (apparently) keeping the session alive. I have read that the Authentication ticket will only be reissued if a postback occurs after half of the specified timeout period has elepsed and this can't the issue as the defrib will have issued requests during the second half of the timeout period - so why was it not reissued?

我想我可以解决这个问题通过设置认证超时到8个小时左右,但是这是一个可怜的修复。

I suppose I could get around the problem by setting the authentication timeout to 8 hours or so but that is a poor fix.

任何人都可以揭示出这个任何光线?

Can anyone shed any light on this?

在此先感谢

查看日志文件证明启发和混乱。我可以看到defribulator射击闲置10分钟后进行,但同时SESSION_ID似乎是整个consitent,窗体身份验证票号的变化 - 不知道这是否应该或不。我现在制定测试计划和会后回来时,我已经完成了他们。
谢谢大家至今谁提供的反馈意见。

Reviewing the Log Files has proved enlightening and confusing. I can see the defribulator firing after 10 minutes of inactivity but while the Session_Id appears to be consitent throughout, the forms authentications ticket ID changes - not sure if it is supposed to or not. I'm formulating a test plan now and will post back when i have completed them. Thanks to everyone who have provided feedback so far.

嗯,我难住了 - 全部的寄托,似乎目前工作正常!被保持的defrib运行(该ID的变化)和会话时认证券进行再生。是不是服务器的问题 - 无法分辨。我以前也遇到过这个问题,并从来没有它的底部,这是非常令人沮丧 - 当然,它不应该这么难。我将不得不因为我得对与应用程序的一些其他方面让这一下降的timebeing。我只好解决此问题code - 这可能永远不会在客户现场发生

Well I'm stumped - everthing seems to be working fine at the moment! The Authentication ticket is being regenerated when the defrib runs (the ID changes) and the session is being maintained. Was it a server issue - can't tell. I have experienced this problem before and never got to the bottom of it and it is very frustrating - surely it should not be this difficult. I'm going to have to let this drop for the timebeing as I have to get on with some other aspects of the application. I'll just have to code around this issue - which may never occur on the customer site.

再次感谢大家的投入 - 如果我做任何进展,我将它张贴回到这里。

Thanks again for everyones input - if I make any progress I will post it back here.

推荐答案

这也可以当IIS回收或终止应用程序池发生。

This may also happen when iis recycles or terminates the application pool.

您可能要检查解决窗体身份验证的这可能是因为客户端失去了他们的饼干。

You may want to check Troubleshoot Forms Authentication It could be that the client lost their cookie.

如果您手动生成身份验证票证,你需要设置code超时,而不是在web.config

If you manually generate the authentication ticket, you need to set the timeout in code and not the web.config

这篇关于窗体身份验证超时,当它不应该?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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