ohhh
You have a well known (ok relativly well known) bug there...
The #15983 bug it looks like.
Afaik this bug was closed from debug in version 4.2.3 so if you are using any other version you should consider an upgrade.
The contents of the bug:
Here is part of what is going wrong. PHP starts out with each session
variable appearing as a global and also in $_SESSION. Initially these
are linked by reference (not clear how) and contain the same data.
This linkage appears to get broken so the contents $GLOBALS['S']
and $_SESSION['S'] are not the same. $GLOBALS contains the latest data,
$_SESSION contains the data as of the start of the page. Consequently
changes to the $_SESSION variable are not being saved between pages.
My workaround is to use the following at the end of each page for $S:
if ( !($_SESSION['S'] === $S) )
$_SESSION['S'] = $S;
This updates the contents of the $_SESSION variable if it is not longer
the same as the global.
Based on a comment from one of the developers, the problem may relate to
having a global declaration for a session variable that appears outside
a function scope.
-----------------------
If you don't want to upgrade the PHP version you can fix it yourself:
The following patch seems to workaround the problem for
--- ext/session/mod_files.c.orig Tue Apr 23 20:10:49 2002
+++ ext/session/mod_files.c Thu Aug 22 11:41:05 2002
@@ -255,12 +255,16 @@
data->st_size = *vallen = sbuf.st_size;
*val = emalloc(sbuf.st_size);
+/*
#ifdef HAVE_PREAD
n = pread(data->fd, *val, sbuf.st_size, 0);
#else
+*/
lseek(data->fd, 0, SEEK_SET);
n = read(data->fd, *val, sbuf.st_size);
+/*
#endif
+*/
if (n != sbuf.st_size) {
efree(*val);
return FAILURE;
I.e., use of the read instead of pread seems to fix
the problem.
I wonder if this is a PHP bug (maybe endianess?)
or a glibc bug.
Chriso
__________________
.........................
Any kiddie in school can love like a fool,
But Hating, my boy, is an Art.
-- Ogden Nash
|