开发者

ASP.NET session expire time

开发者 https://www.devze.com 2023-03-07 01:24 出处:网络
I want to开发者_开发百科 set the session life span to 2h, but i\'m not sure how. If I set the <sessionState timeout=\"120\" /> in web.config I still get logged out every few minutes. Am I settin

I want to开发者_开发百科 set the session life span to 2h, but i'm not sure how. If I set the <sessionState timeout="120" /> in web.config I still get logged out every few minutes. Am I setting it wrong ? Thanks!


your timeout is mostlikely not session but authentication, look for the below line and change that:

 <authentication mode="Forms">
  <forms name=".EMSOLG_ASPXAUTH" timeout="120" />
</authentication>


You can use session timeout in codebehind like this

Session.Timeout = 120;


If you have hosted the website in IIS , you can configure the required timeout in IIS.

0

精彩评论

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