Dkong
Dkong

Reputation: 2788

Session keeps timing out

My session keeps timing 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" />

Upvotes: 4

Views: 1794

Answers (2)

SK INFOPOINT
SK INFOPOINT

Reputation: 36

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.

Upvotes: 0

M4N
M4N

Reputation: 96626

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)

Upvotes: 1

Related Questions