Ok, I've just started looking into sessions and was messing around with simple stuff, like incrementing the user's session value every time they requested the page, but I came across the following problem:
I was trying to do the following
It quickly became apparent that the value of the counter only reflected the value of the session variable, meaning I can't increment the counter variable.
$counter = $_SESSION['counter'];
// Try incrementing $counter now that it points to the session variable
The way to do it would be:
So I was just wondering if there was a way of transferring the value to the $counter variable, instead of merely reflecting what is held in the session.
In its current state I can only echo the $counter, but I can't add anything to it, or perform any operations on it.
Any way to get around this?