开发者

Session keeps timing out

My session keeps timi开发者_如何学Pythonng out in just a few minutes even though I've specified a 200 minute expiry.

In my web.config I've set the timeout for the forms and the sessionState. I've looked at some other similar questions on Stack Overflow but still can't suss this.

<authentication mode="Forms">
  <forms loginUrl="~/Default.aspx" defaultUrl="~/secure/Default.aspx"
    timeout="180"/>      
</authentication>

<sessionState mode="InProc" cookieless="false" timeout="200" />


Maybe your application gets recycled?

This can be caused by changing web.config files, the contents of the bin folder or by deleting (temp) folders in your application. (and probably there exist other reasons as well)


use the following line in code behind of aspx page:

Session.Timeout = 180;

This line should be written in Page_Load event and at the top of Page Load Event.

I hope this answer may help you.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜