Hello Reader's!, If you want to make the custom php session which will destroy automatic then you can use the code as below:-
session_start(); // ready to go!
$now = time();
if (isset($_SESSION['discard_after']) && $now > $_SESSION['discard_after']) {
session_unset();
session_destroy();
session_start();
}
Here either new or old, it should live at most for another hour
this session has worn out its welcome. It will start a new one
$_SESSION['discard_after'] = $now + 3600;
0 Comment(s)