﻿// JScript File

var keepSessionTimeout = 10 * 60 * 1000 //every 10 minutes to be safe

setTimeout("keepSession();", keepSessionTimeout );

var req = null;

function keepSession()
{
  var url = "anotherpage.htm";
      
      if ( window.XMLHttpRequest ) 
      {
            req = new XMLHttpRequest();
      } 
      else if ( window.ActiveXObject ) 
      {
            req = new ActiveXObject("Microsoft.XMLHTTP");
      }
      
      req.open("GET", url, true);
      req.onreadystatechange = keepSessionCallback;
      req.send(null);
        setTimeout("keepSession();", keepSessionTimeout );
}

function keepSessionCallback()
{
      if (req.readyState == 4) 
      {
        if (req.status == 200) 
            {
                  //the page request was a success
            }
      }
}
