BennoDual
BennoDual

Reputation: 6279

Change Timeout for ASP.NET Application

I have a ASP.NET-Application. There I have a page (CustomerHealthControl.aspx) with a Button. At the end of the Button-Click-Handler, I call:

Response.Redirect("~/Licensee/CustomerHealthControl.aspx?CustomerID=" + CustomerID.ToString())

to refresh the page.

Now, when the user stays some minutes (about 5minutes) on the page and then he clicks this Button, the Application will not redirect to CustomerHealthControl.aspx. Instead, it will redirect to the Default-Page (Login.aspx).

I have set the fallowing settings in the web.config, but it doesn't increase the timeout:

<system.web>
   <sessionState timeout="300"  />
   ...
<system.web>

I have read in the docs, that the default should be 20 minutes - but my timeout occurs after about 5 minutes.

Does someone have a hint for me, where I can increase this timeout? - Thanks.

Upvotes: 0

Views: 636

Answers (1)

kenchilada
kenchilada

Reputation: 7559

Sounds like the browser is caching the response. Since no request is sent to the server on subsequent requests, the session is never updated and goes stale.

You may need to add appropriate HTTP headers for cache control to direct browsers not to cache the page.

Upvotes: 1

Related Questions