I've a strange problem with $_SESSION variables in PHP.
page1.php sets
$_SESSION['progress'] = 1;
In page2.php, I have the following code:
if ($_SESSION['progress'] === 1) {
$_SESSION['progress'] = 2;
}
Both files start with session_start(). page1.php contains a link which calls page2.php.
If I log the $_SESSION['progress'] variable, it doesn't change at all. Why? Are $_SESSION variables more like constants: once defined they can't be changed again? Are there any similar techniques? I basically need something to track the progress of several users. A database is not an option.
Thank you!