Hi,
i have problems with the new session-handling in php4.
It works only with some strange behavior.
Here is a little sample code to test the sessions.
<?php
session_start();
if(!$PHPSESSID) {
print "Session not registered<br>";
$id = session_id();
print "Session-id: $id<br>";
$count = 0;
session_register("count");
}
else {
if (!session_is_registered("count")) {
print "Session registered<br>";
session_id($PHPSESSID);
$id = session_id();
print "Session-id: $id<br>";
session_register("count");
}
else {
print "Count registered";
}
}
$count++;
?>
I configured php4 like this:
./configure --with-apxs=/usr/local/apache/bin/apxs --enable-force-cgi-redirect --enable-discard-
path --with-mysql=/usr/local/mysql --enable-trans-sid --enable-track-vars --enable-shared --disa
ble-static --enable-versioning --without-gd
Ok then load the page and get something like this:
Session not registered
Session-id: 1d53a7a7d30b4b7a2a8ff4b49b5e4d72
Hello visitor, you have seen this page 1 times.
is necessary to preserve the session id # in the case that the user has disabled cookies ?> To continue, click here
Next click on the link i get:
Session registered
Session-id: 1d53a7a7d30b4b7a2a8ff4b49b5e4d72
Hello visitor, you have seen this page 1 times.
is necessary to preserve the session id # in the case that the user has disabled cookies ?> To continue, click here
and finally when i click the link again i get this:
Count registered Hello visitor, you have seen this page 2 times.
is necessary to preserve the session id # in the case that the user has disabled cookies ?> To continue, click here
From this time on it will count.
Where is the problem ????
sincerley Andreas