Forum Moderators: coopster
++$_SESSION['test'];
print_r($_SESSION);
<?php
if (session_id() == ""){
session_start();
}
++$_SESSION['test'];
print(session_id());
print_r($_SESSION);
?>
In PHP 4.3.9 the session_id stays the same from page load to page load and the array item "test" increments by one each time. With PHP 5.1.4 the session_id stays the same as well but "test" doesn't increment at all but rather stays at 1. I've tested this in both Firefox and Safari.
Any ideas? It's like it isn't retaining the value. I ran the same script above on my laptop with Apache and PHP 5.2.1 and it worked just fine, incrementing as it should.