Ver Mensaje Individual
  #4 (permalink)  
Antiguo 09/11/2014, 22:34
keivis
 
Fecha de Ingreso: julio-2013
Mensajes: 123
Antigüedad: 10 años, 10 meses
Puntos: 1
Respuesta: cerrar sesión por inactividad

tengo este pero tampoco me funciona....

Código Javascript:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Documento sin título</title>
  6. <script  src="jquery-1.11.1.min.js"></script>
  7. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  8. <script type="text/javascript">
  9. var time;
  10. function inicio() {
  11.   time = setTimeout(function() {
  12.     $(document).ready(function(e) {
  13.     $.ajax({
  14.         url:'server/include/verisession.php',
  15.         type:'POST',
  16.         data:'veri=1',
  17.         success: function(data){           
  18.             if(data == 1)
  19.             {
  20.                 alert("Sesion Caducada");
  21.                     document.location.href='index.html';               
  22.             }          
  23.         }  
  24.        
  25.     });
  26. });
  27.     },180000);//fin timeout
  28. }//fin inicio
  29.  
  30. function reset() {
  31.   clearTimeout(time);//limpia el timeout para resetear el tiempo desde cero
  32.   time = setTimeout(function() {
  33.     $(document).ready(function(e) {
  34.     $.ajax({
  35.         url:'server/include/verisession.php',
  36.         type:'POST',
  37.         data:'veri=1',
  38.         success: function(data){           
  39.             if(data == 1)
  40.             {
  41.                alert("Sesion Caducada");
  42.                document.location.href='index.html';            
  43.                
  44.             }          
  45.         }  
  46.        
  47.     });
  48. });
  49.     },180000);//fin timeout
  50. }//fin reset
  51. </script>
  52.  
  53. </head>
  54.  
  55. <body  onload="inicio()" onkeypress="reset()" onclick="reset()" onMouseMove="reset()">
  56. gghghghg
  57. </html>