6

Find server data without extending session timeout

 3 years ago
source link: https://www.codesd.com/item/find-server-data-without-extending-session-timeout.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Find server data without extending session timeout

advertisements

Are there any ways in ASP.net to fetch data from the server without extending the session timeout? This needs to be done every few minutes without user interaction until the page is closed.

Additional context, as requested:

The pages in my webapp needs to poll the server every few minutes to check for a particular condition (emergency maintenance scheduled for 30 minutes time, in this instance). When the condition is true, the page will display a message to the user. When the condition is false, nothing needs to happen.

As I understand it, postbacks to the server reset the time until the session expires. We do not want the session to be extended/refreshed/reset/whatever the word is every time the page polls the server. I need a way to poll the server automatically without resetting the session timeout.

Thanks.


If you're asking in the context of a lengthy HTTP request, so that you're looking to prevent an HTTP timeout, look at web.config's <httpRuntime executionTimeout="99999"></httpRuntime> where executionTimeout is in seconds I think, http://msdn.microsoft.com/en-us/library/e1f13641(v=vs.71).aspx.

If it is truly just a session timeout issue, is it possible to asynchronously ping the server under the same user session, while the lengthy process is running?

Edit: Based on your edit, if you partition your "web site maintenance" web service into a service outside of the session state scope of the normal part of the site, then you can call it as often as you'd like. If you're using an ASMX web service in your current website at this time, for example, simply partition it into a separate application, perhaps as a directory off of your application, so that it falls under the same domain. I imagine that would work fine.

I'm not sure what web service type you're invoking at this time (ASMX, WCF, etc.), or even if the web service that you're invoking at this time is in the same application as your ASPX application pages.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK