I have a homepage the user logins in too with this php code:
<?php
session_start();
$username= $_SESSION['username'];
if($_SESSION['username'] == "")
{
header("Location: http://new_system/");
}
require "connection.php";
$result= mysqli_query($conn,"SELECT * FROM users WHERE username = '$username'");
$row = mysqli_fetch_row($result);
$firstname = $row[0];
$lastname= $row[1];
$email = $row[2];
$birthday = $row[4];
$gender = $row[5];
$path = $row[8];
?>
I tried adding this
$_SESSION["timeout"] = time()+ (0*1*0*0);
So it logs out after a day but it didn't work, can anyone tell me why. I put it under the if statement for session