$inactive)) { header('Location: ../logout/?coupon='.$coupon); } $_SESSION['testing'] = time(); // Update session } else{ if (isset($_SESSION['testing']) && (time() - $_SESSION['testing'] > $inactive)) { header('Location: ../logout'); } $_SESSION['testing'] = time(); // Update session } ?>