Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active October 23, 2019 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/64b85c63f344b1078175ae2cca3379ec to your computer and use it in GitHub Desktop.
Save parzibyte/64b85c63f344b1078175ae2cca3379ec to your computer and use it in GitHub Desktop.
<?php
?><!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Mi página web</title>
</head>
<body>
<p>Aquí el usuario puede tardar lo que quiera, su sesión no se va a
cerrar por inactividad</p>
<script>
document.addEventListener("DOMContentLoaded", function(){
// Invocamos cada 5 segundos ;)
const milisegundos = 5 *1000;
setInterval(function(){
// No esperamos la respuesta de la petición porque no nos importa
fetch("./refrescar.php");
},milisegundos);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment