开发者

ASP.NET session expire time

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜