Skip to content

Instantly share code, notes, and snippets.

View snkhan120's full-sized avatar
🎯
Focusing

Ahsan Khan snkhan120

🎯
Focusing
View GitHub Profile
@psdtohtml5
psdtohtml5 / gist:6090113
Last active September 5, 2021 16:09
PHP : Auto expire session / Auto logout after specific time
<?php
//on pageload
session_start();
$idletime=60;//after 60 seconds the user gets logged out
if (time()-$_SESSION['timestamp']>$idletime){
session_destroy();
session_unset();
}else{