Response.IsAuthenticated是假后30秒 [英] Response.IsAuthenticated Is False After 30 Seconds

查看:158
本文介绍了Response.IsAuthenticated是假后30秒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经部署到一个共享的托管服务的ASP.NET应用程序MVC3。它使用FormsAuthentication和SSL:

I have an ASP.NET MVC3 application deployed to a shared hosting service. It uses FormsAuthentication and SSL:

<authentication mode="Forms">
  <forms loginUrl="~/Home/Index" timeout="240" requireSSL="true" />
</authentication>

问题是在一些剃刀(部分)的观点:我执行一个回调到用于测试的目的,只是睡觉,并返回一个PartialView一个控制器方法。我的问题是围绕Response.IsAuthenticated。这是回调和睡前真实,只要事后的睡眠是30秒或更少仍是如此。不过,我与不同持续时间较长(例如55秒)和Response.IsAuthenticated成为在这种情况下错误的进行了测试。这是一个问题,因为我原来的code,我需要做一个重定向(通过JS,open.window,在我的部分图)。由于Response.IsAuthenticated是假FluentSecurity直接将用户到loginUrl(我不希望)。

The problem is in some Razor (partial) views: I execute a callback to a controller method which, for purposes of testing, simply sleeps and returns a PartialView. My question revolves around Response.IsAuthenticated. It is true before the callback and sleep and remains true afterwards as long as the sleep is 30 seconds or less. However, I've tested it with various longer durations (e.g. 55 seconds) and Response.IsAuthenticated becomes false in those cases. This is a problem because in my original code I need to do a redirect (via JS, open.window, in my Partial View). Since Response.IsAuthenticated is false FluentSecurity immediate sends the user to the loginUrl (which I don't want).

看来,这将是地方与超时(KeepAlive报,ServerTimeout?),但我GOOGLE response.isauthenticated超时并拿出什么。坦率地说,这种行为似乎整个站点中发生:如果用户离开页面坐(我使用FF)超过一分钟左右,然后当他们尝试访问它们被自动重定向到l​​oginURL的页面。请注意,我的会话超时设置为120。有趣的是,我没有遇到此问题时,应用程序部署到Windows Azure(还有其他的问题,虽然);它刚开始的时候我切换到另一台主机发生的事情。

It seems that this would be related to a timeout somewhere ("KeepAlive","ServerTimeout"?) but I've Googled response.isauthenticated timeout and come up with nothing. Frankly, this behavior seems to be occurring throughout the site: if the user leaves the page sitting (I'm using FF) for more than a minute or so then when they try to access a page they are automatically being redirected to the loginURL. Note that my session timeout is set to "120". Funny thing is I did not experience this behavior when the app was deployed to Windows Azure (there were other issues, though); it just started happening when I switched to a different host.

任何指针信息关于这个主题将是AP preciated。

Any pointers to info on this topic would be appreciated.

推荐答案

也许主机查杀程序池的服务器时,它是一个几秒钟的空闲。

Maybe the host is killing the AppPool in the server when it is a few seconds idle.

您登录应用程序关闭事件,看看是否是这样的话:的 http://weblogs.asp.net/scottgu/archive/2005/12/14/433194.aspx

You log the app ShutDown event to see if that's the case: http://weblogs.asp.net/scottgu/archive/2005/12/14/433194.aspx

这篇关于Response.IsAuthenticated是假后30秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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