I am just wondering if anybody knows any differences in the PHP Session Handling from version 4.0.3pl - 4.1.1.
$expireTime = 5; // 5 seconds, just for testing purposes
$currentTime = time (); // Current time (in seconds)
$sessionExpire = $currentTime - $expireTime; // The expiry time of the session
if (!session_is_registered("sessionStart")) {
$HTTP_SESSION_VARS["sessionStart"] = $currentTime;
echo "Session Set.";
}
else {
if ($HTTP_SESSION_VARS["sessionStart"] < $sessionExpire) {
session_unset ();
session_destroy ();
echo "Your session has expired, please re-<a href='$PHP_SELF'>login</a>.";
} // End of sessionStart check IF statement
else {
session_unregister ("sessionStart");
unset ($sessionStart);
$HTTP_SESSION_VARS["sessionStart"] = $currentTime;
echo "Session Reset.";
}
}
This works in PHP 4.1.1. But doesn't act the same in 4.0.3pl1.
The problem seems to be around the:
if (!session_is_registered ("sessionStart")) {
This alwasy returns true (no session var).
Any ideas are greatly appreciated.
Thanks,
-Travis