ID:               19022
 Comment by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           No Feedback
 Bug Type:         Session related
 Operating System: linux (rh7.3), apache 1.3.26
 PHP Version:      4.2.2
 New Comment:

I'm experiencing this too, and I might have some usefull feedback!

I don't see the 'failed to write' messages. But I do have the random
loss of sessions. I've modified my script so I get an email with all
GET_VARS, SERVER_VARS etc. whenever the sessiondata is lost.

I found a very weird thing with respect to the session cookie. It
contained:

HTTP_COOKIE          = 1; PHPSESSID=f1faf3374d562e8738f64e7e7e030972;
pollvoted[1]=1;  (... some other data left out for privacy reasons);
PHPSESSID=842be4994a9c424fd7d4f9f8049aadc9

There are two separate PHPSESSID's in the same cookie! Maybe one of the
too is indeed invalid (no session date) How is this possible?


Previous Comments:
------------------------------------------------------------------------

[2002-10-15 09:40:21] [EMAIL PROTECTED]

Hello,
I am also experiencing this bug.  I am using Debian, 2.4.18 kernel, SMP
machine, PHP 4.2.3. (also observed bug on PHP 4.1.2).  The server is
not experiencing a heavy load.

I am attempting to script a temporary fix for this bug until there is a
permanent fix in a stable PHP release.  Would something like the
following work?

1. At the end of every page request, backup the session file:

copy(session_save_path() . '/sess_' . session_id(), 
    session_save_path() . '/sess_' . session_id() . '_bak');


2. At the top of each script that requires session data, check to see
if the main session file has been truncated.  If so, replace it with
the backup that you have created.  Assuming you have the session Id
stored in a cookie as 'user_sess_id':

if (isset($_COOKIE[user_sess_id])
    && file_exists(session_save_path() . '/sess_' .
$_COOKIE[user_sess_id] . '_bak')
    && file_exists(session_save_path() . '/sess_' .
$_COOKIE[user_sess_id]) && (filesize(session_save_path() . '/sess_' .
$_COOKIE[user_sess_id]) == 0)
    && (filesize(session_save_path() . '/sess_' .
$_COOKIE[user_sess_id] . '_bak') > 0) ) {
    // restore the session file
    copy(session_save_path() . '/sess_' . $_COOKIE[user_sess_id] .
'_bak', session_save_path() . '/sess_' . $_COOKIE[user_sess_id]);
}
// continue with script...

Does this have any hope of helping restore the lost session data?  Or
would PHP have already read in the session data from the file on disk
before it reaches this point of processing the code?

Any advice on how PHP coders can write a temporary fix for this bug
would be greatly appreciated.
Thanks,
Taylor Davis

------------------------------------------------------------------------

[2002-10-14 19:26:52] [EMAIL PROTECTED]

No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------

[2002-09-26 12:08:25] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip



------------------------------------------------------------------------

[2002-09-18 06:52:29] [EMAIL PROTECTED]

hi,

sorry been quite busy lately. I upgraded to php4.2.3 today .. still the
same problem. I hope i'll have some time to test a actual snapshot
today/tommorrow.

testing on production server sucks, but the problem itself is even
worse.

stay tuned,
thomas

------------------------------------------------------------------------

[2002-09-06 04:39:27] [EMAIL PROTECTED]

Trying snapshots isn't an option on production servers..

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/19022

-- 
Edit this bug report at http://bugs.php.net/?id=19022&edit=1

Reply via email to