This code seems to work good for me:
<div class="skeleton " id="timer" style="color:gr ay;font-family: Verdana;
font-size: 8pt">
</div>
<script language=javasc ript>
var dd=<%= Session.Timeout *60-2 %>;
var csptimeout=0;
function CSPstartClock(r eset,timeout,wh atdoc,towhere) {
if (reset) {
md=dd
}
if (md>0) {
time=md*1000
if (csptimeout!=0) {
clearTimeout(cs ptimeout);
}
csptimeout=setT imeout("CSPstar tClock(0)",1000 )
dhour=Math.floo r((time%(60*60* 1000*24))/(60*60*1000)*1)
dmin=Math.floor (((time%(60*60* 1000*24))%(60*6 0*1000))/(60*1000)*1)
dsec=Math.floor ((((time%(60*60 *1000*24))%(60* 60*1000))%(60*1 000))/1000*1)
dsecDisplay = dsec.toString() ;
dminDisplay = dmin.toString() ;
if (dminDisplay.le ngth == 1) {
dminDisplay = "0" + dminDisplay ;
}
if (dsecDisplay.le ngth == 1) {
dsecDisplay = "0" + dsecDisplay ;
}
self.document.g etElementById(' timer').innerHT ML=dhour+':'+dm inDisplay+':'+d secDisplay+' remaining until session timeout';
}
else {
if(timeout==nul l) { timeout='1790'}
if(whatdoc== null) { whatdoc=''; if(whatdoc=='')
{whatdoc='docum ent.location.hr ef';}}
if(towhere==nul l) { towhere='/osc2.0/osc_scripts/abandonSession. asp';}
mycounter = setTimeout(what doc+'="'+towher e+'"',1000)
}
md=md-1
}
CSPstartClock(1 );
</script>
"polilop" wrote:
Is there a way to see if the session is going to timeout and then warn the
user or display a page that it timed out