0

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.

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

where can I add this headers?
Cache-control headers are part of the HTTP response. You can set them directly, or use various helpers within the ASP.NET framework to do so. See here and here.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.