hehehe ho fatto una prova di questo sistema e la sessione continua ad estendersi
per bloccare l'apertura della popup dopo un tot di volte bisogna agire latoclient
codice:
<script language="javascript">
var stopEstensione=false
var secondi = (60*20)
var timerCountDown
function CountDown(Secondi){
var dd = document.getElementById('divContoRovescia')
if(Secondi==0){
dd.innerHTML = 'Sessione scaduta!'
}
else{
var time = new Date()
time.setTime((Secondi*1000)-(60*60*1000));
var tiempo = time.getHours()+'.'+time.getMinutes()+'.'+time.getSeconds();
dd.innerHTML = tiempo
timerCountDown = setTimeout('CountDown('+(Secondi-1)+')',1000);
if(Secondi==60 && !stopEstensione){
window.open('estendiSessione.asp','es','top=2000');
}
}
}
function ReStartCountDown(){
clearTimeout(timerCountDown);
CountDown(secondi);
}
</script>
<BODY onload="CountDown(secondi)">
<div id="divContoRovescia"></div>
e estendiSessione.asp
codice:
<%
if Session("ContoEstensione")="" then Session("ContoEstensione")
Session("ContoEstensione")=Session("ContoEstensione")+1
if Session("ContoEstensione")>=3 then
stopEstensione="true"
else
stopEstensione="false"
end if
%>
<HTML>
<HEAD>
</HEAD>
<BODY onload="if(window.opener){window.opener.ReStartCountDown();window.opener.stopEstensione=<%=stopEstensione%>;}self.close();">
</BODY>
</HTML>