How to avoid session timeout in

How do I in Javascript manage the session timeout problem of an app? The hosting company (WebHost4Life) has set a standard session timeout of 90 sec (!!!???) which I am not allowed to override in my web.config file!
I have included an asp:timer control in an updatepanel  (in the master page) which keeps the app alive.
But I get a problem, because I have several updatepanels elsewhere in the app and theese updatepanels (which has updatemode=always) should not be refreshed every time I initiate the session timeout handling (each minute!).
I have seen some javascripts that are said to keep the app alive, but I cannot get them to work
Who is Participating?
rockiroadsConnect With a Mentor Commented:
as this is a common issue there should be plenty of examples on the web
(something similar to above lol but in code)

JoarAuthor Commented:
I tried this one, but didn't work for me for some reason. Found this one which worked:

<script language="javascript" type="text/javascript">
function fnKeepSessionAlive()
    var myurl = "SessionKeepAlive.aspx";

if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest()
else {
xhttp = new ActiveXObject("Microsoft.XMLHTTP")
}"POST", myurl, true);

window.setTimeout("fnKeepSessionAlive();", 60000);


sweet. thanks for the update. great post!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.