I'm working with sessions for the first time and why does the variable $session_life always = 0?
$_SESSION['time'] = time();
$inactive = 30;
$session_life = time() - $_SESSION['time'];
I'm working with sessions for the first time and why does the variable $session_life always = 0?
$_SESSION['time'] = time();
$inactive = 30;
$session_life = time() - $_SESSION['time'];
If those expressions happen one after the other what you're doing is essentially:
time() - time();
which is likely to return 0.