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.
精彩评论