Created
September 6, 2022 11:21
-
-
Save Michaelkodji/95ff6070f7237a51010282988673a810 to your computer and use it in GitHub Desktop.
Disconnect user or session after five minutes of inactivity (déconnecter un utilisateur après 5min d'inactivité )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="fr"> | |
<head> | |
<meta charset="utf-8"> | |
<script type="text/javascript" src="activite.js"></script> | |
</head> | |
<body onkeydown="activite_detectee = true;" onmousemove="activite_detectee = true;"> | |
<p>Bienvenue sur le tabeau de bord </p> | |
</body> | |
</html> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var activite_detectee = false; | |
var intervalle = 50000; | |
function testerActivite() { | |
if(activite_detectee) | |
activite_detectee = false; | |
else { | |
window.location.href = 'index.php?controller=control_deconnexion'; | |
} | |
setTimeout('testerActivite();', intervalle); | |
} | |
setTimeout('testerActivite();', intervalle); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment