The following script is from the php4 documentation
<?php
function open ($save_path, $session_name) {
echo "open ($save_path, $session_name)\n";
return true;
}
function close () {
echo "close\n";
return true;
}
function read ($key) {
echo "read ($key)\n";
return "foo|i:1;";
}
function write ($key, $val) {
echo "write ($key, $val)\n";
return true;
}
function destroy ($key) {
return true;
}
function gc ($maxlifetime) {
return true;
}
session_set_save_handler ("open", "close", "read", "write", "destroy", "gc");
session_start();
echo $foo;
?>
On my computer at work running on php4.0 it executes perfectly with the following
output:
open (/tmp, PHPSESSID) read (f4a6e6cb93bdb1b36fcedc7ea1283780) 1 write (f4a6e6cb93bdb1b36fcedc7ea1283780, foo|i:1😉
close
On my computer at home running on php4.01pl2 (latest version I think) the write
function is never called:
open (/tmp, PHPSESSID) read (2c0b4ffcf5076fa5b99cb93e672445e9) 1
Both installations have identical php.ini files and the only difference is that
my php4 at home was compiled with --enable-trans-sid and gd library.
Is this a bug that earlier versions don't have or does anyone have an idea ?