开发者

Asp.net session variable timeout

开发者 https://www.devze.com 2023-03-18 16:32 出处:网络
I\'m using asp.net (.net 4.0) on iis6, and have a sessionvariable that is gone after about 20-30 mins.

I'm using asp.net (.net 4.0) on iis6, and have a sessionvariable that is gone after about 20-30 mins.

I've tried everything I could find on the internet:

My web.config contains:

<sessionState mode="InProc" cookieless="false" timeout="120" />
<httpRuntime 开发者_Go百科requestValidationMode="2.0" maxRequestLength="204800"
executionTimeout="3600" />
<forms loginUrl="/subsidies/inlog.aspx" name=".ASPXFORMSAUTH" timeout="120" />
<membership defaultProvider="MyMembershipProvider" userIsOnlineTimeWindow="121">

Machine:

c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Config\web.config

<system.web>
  <sessionState timeout="120" />

Application pool:

Recycle worker processes (in minutes) : 120

Shutdown worker processes after being idle for (time in minutes): 120

Website properties:

Connection timeout: 120 seconds

Home Directory > Configuration > Options > Application Configuration >

  • x Enable session state (enabled)
  • Session timeout: 120 minutes

And still, a session variable is gone in about 20-30 minutes. Hopefully someone can help me....


I finally found the problem. It's fixed.

The problem was the Application Pool. On every recycle, the session was lost. So we did turn off the application pool recycling, and are scheduling the recycle once a day.


You seem to be using Forms Authentication. Be sure you have slidingExpiration set to False in your web.config.

0

精彩评论

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

关注公众号