my code is this
<?php
echo '<font color ="red">sesion akan di destroy dalam 5 detik</font>';
$inactive = 5;
ini_set('session.gc_maxlifetime', $inactive);
session_start();
if (isset($_SESSION['testing']) && (time() - $_SESSION['testing'] > $inactive)) {
session_unset();
session_destroy();
header("location: index.php");
}
$_SESSION['testing'] = time();
?>