php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5276 PHP 4.0.1: session_set_save_handler/session write fails
Submitted: 2000-06-29 20:46 UTC Modified: 2000-08-02 14:11 UTC
From: tep at sportbug dot net Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.1 Release OS: RH 6.2 Linux
Private report: No CVE-ID: None
 [2000-06-29 20:46 UTC] tep at sportbug dot net
Using the session_set_save_handler to set call back functions for session managment.

The session write function does not get called instead the error message from line 495 in session.c is given in the php error log "Failed to write session data....."

The open and read callbacks are called and work.

The code (see below) worked in PHP 4.0.0

Notes:  using the default session settings in php.ini except for cookie_lifetime = gc_maxlifetime = 3600

Code:
Sample code from http://www.zend.com/manual/ref.session.php Example 2 (cut and paste)

except add the line:
session_register('foo');



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-29 21:12 UTC] tep at sportbug dot net
The handlers starting working correctly by setting 
session.save_handler = user
in the php.ini file.

The code worked without it in PHP 4.0.0

Thanks go to Chris Adams for suppling the fix:
> Set session.save_handler = user in your php.ini. It took me a little create searching to find this
> from previous posts to this list. Arguably session_set_save_handler should either override this
> directly or none of the overridden calls should work. However, I have a feeling that by the time the
> write handler is called, PHP has already cleared out the temporary setting changes made by your
> script.

 [2000-06-29 21:38 UTC] tep at sportbug dot net
session_set_save_handler should probably be fixed so that php.ini does not need to be modified or else better documentation?
 [2000-08-01 23:13 UTC] waldschrott@php.net
Please verify that it?s still happening using the latest version of PHP (release 4.0.1pl2 or CVS).
 [2000-08-02 11:49 UTC] waldschrott@php.net
ok., but did you try the latest version from CVS or just the lastest release, there have been some fixes which *might* be realted to your problem
 [2000-08-02 14:11 UTC] waldschrott@php.net
should be fixed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 30 22:01:28 2024 UTC