Session Timeout in ASP.NET
I have written a page with an iFrame that basically cycles through a series of internal pages on our server displaying daily activity for our company. The problem I think is that it sporadically loses its session and redirects back to the login screen to keep losing its session which is the default behavior for anyone on our site trying to access a 开发者_如何学Pythonwebpage without being logged in.
I have set the session timeout to 4hrs, the iframe cycles through 6 pages anywhere from 10 seconds to 5 minutes on each, and I have even set the META refresh on the page to refresh every 3 hours. I don't understand what else could possibly stop this page from staying active.
Maybe this could help you: keep-session-alive
Check the authentication cookie timeout.
<authentication mode="Forms">
<forms name="ApplicationLogin" loginUrl="Login.aspx" path="/" protection="All" timeout="240">
</forms>
Maybe your application pool is timing out.
IIS takes precedence, but they deal with slightly different scenarios.
In the case of IIS, the default 20 minutes time-out for the application pool is referring to incoming requests. If your application doesn't receive any requests at all for 20 minutes then the application pool is put to sleep to save resources. When this happens all the sessions in your application are gone.
The ASP.NET session time-out deals with per-session requests. Your site could be quite busy, but if one user (i.e. session) is not active for 20 minutes only that session is discarded.
So yes, to make sure the session stays alive for 60 minutes you have to change the time-out settings for the IIS application pool as well as web.config.
ASP.NET 2.0 Session Timeout
精彩评论