Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

White screen issue, if an user stays idle in an asp.net page

Tags:

asp.net

In our ASP.NET website one of the page has some tabs in it. Each tab represents different content and moving from one tab to another reloads the entire page. If I'm currently in one of the tab and stay idle there for around a minute or more and then move on to an another tab, only a white blank screen comes up.(with no page source code info for that in the browser).

Sadly this same issue is not at all reproducible for the same website in lower testing environment. Issue is occurring only in Production version of the website.

Is there an IIS setting or web.config setting which I should change to resolve this issue. As I believe the source code of the concerned webpage wouldn't be a reason.

like image 428
Kings Avatar asked Apr 18 '13 11:04

Kings


3 Answers

This is probably because the session timeout has reached the limit ending the session.

You have three possible solutions in this case:

First

You can try editing the web.config file located on the root of your application to extend the session timeout. Try something like this:

<sessionState mode="StateServer" timeout="500">

</sessionState>

According to MSDN you can set timeout up to 525,601 minutes (1 year).

Second

If it doesn't work and you have access, you can try editing the timeout on IIS:

Open the IIS, click on the Application Pools, Select the Application pool for your application.

Right Click on that, Select Properties.

In the Performance tab, Set the idle timeout as your desired minutes for "shutdown worker processes after being idle for ..... minutes".

IMPORTANT: Apart from this you have to set the timeout in web.config as said above.

Third

You can create an ajax function to be executed in background, preventing the session from expiring:

function keepSessionAlive(mod) {
mod.open("GET", "blank.html", true);            
mod.onreadystatechange = function() {
    if (mod.readyState == 4) {          
        document.getElementById("#blankDiv").innerHTML = mod.responseText;
    }
};  
mod.send(null)
}
setInterval('keepSessionAlive()', 100000);

That's it. Hope it helps.

like image 110
A. Cristian Nogueira Avatar answered Sep 22 '22 07:09

A. Cristian Nogueira


Are u usin any custom http module? Can we have a look at the page souce aspx and code behind? It happened to me when i used elmah but in quite different scenario.

Other may be due to the session thing that other pointed out. Hope that helps.

like image 27
user2196407 Avatar answered Sep 23 '22 07:09

user2196407


I would open the chome dev tools or firebug if in firefox. If in firebug, I would go look at the net and console tabs and see what's actually happening from a network perspective. It should be easy to look at the traffic in dev and compare to production. I'm guessing they aren't the same, and it would instantly point you in the right direction.

Fiddler is also an option if you want to watch the traffic as if you were a middle-man.

like image 43
archangel76 Avatar answered Sep 23 '22 07:09

archangel76