开发者

ASP.NET HttpContext.Current.Application Lifespan

开发者 https://www.devze.com 2023-03-07 06:52 出处:网络
I have a web service that is tracking a user across operation calls. I\'m storing my users\' information in the HttpContext.Current.Application variable, which is a HttpApplicationState. I\'ve noticed

I have a web service that is tracking a user across operation calls. I'm storing my users' information in the HttpContext.Current.Application variable, which is a HttpApplicationState. I've noticed that sometimes, my key is开发者_StackOverflow中文版 there, sometimes it is not. Because of this, I assume that the duration of my application state is expiring.

Is there a way to configure this? If so, how?

THank you!


After x minutes of idle time, IIS will terminate the worker processes. I assume that HttpApplicationState will then be lost.

You can disable idle timeout, see How to prevent/extend idleTimeout in IIS 7?


The application will be unloaded through the iss after a idle time. You can set this idletime to 0 in the properties of the application pool. With the setting 0 the iis will never unload your app.

0

精彩评论

暂无评论...
验证码 换一张
取 消