|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48922 session_set_save_handler() appears to cause all processing to stop
Submitted: 2009-07-14 19:48 UTC Modified: 2009-07-29 12:25 UTC
Avg. Score:4.4 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:0 (0.0%)
From: bobby at indesignfirm dot com Assigned:
Status: No Feedback Package: Session related
PHP Version: 5.2.10 OS: RedHat 2.6.9-42.0.8.EL #1
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-07-14 19:48 UTC] bobby at indesignfirm dot com
Server upgraded from 5.2.9 last night and suddenly any scripts using custom session set save handler has stopped working.

No errors reported, all processing just stops.

Un-commenting the code makes everything come back to life.

Reproduce code:
function open($savePath, $sessName) {
        return true;
    function close() {
        return true;
    function read($sessID) {
        //Lookup the session in the database
        $readquery = new QueryCall();
        $readquery->AddVariable('TEXT', $sessID);
        //Now return the data we get back from the database
        return $readquery->procedureResults[0]['d'];
    function write($sessID,$sessData) {
        //Write the session data to the database
        $writequery = new QueryCall();
        $writequery->AddVariable('TEXT', $sessID);
        $writequery->AddVariable('TEXT', time());
        $writequery->AddVariable('TEXT', $sessData);

        //Now return true just to keep it happy
        return TRUE;
    function destroy($sessID) {
        //Destroy the session that we need to get rid of
        $destroyquery = new QueryCall();
        $destroyquery->AddVariable('TEXT', $sessID);

        //Return True just to make everything happy
        return TRUE;
    function gc($sessMaxLifeTime) {
        //Calculate what the time limit is
        $timelimit = time() - $sessMaxLifeTime;
        //Let's do some garbage collection
        $garbagequery = new QueryCall();
        $garbagequery->AddVariable('TEXT', $timelimit);
        //Return true just to make everything happy
        return TRUE;

session_set_save_handler('open', 'close', 'read', 'write', 'destroy', 'gc');

Expected result:
Session information should be stored in the database and has been working for several months now.  Since the upgrade of 5.2.10 it has stopped working.  No code changes have been made to application

Actual result:
Blank page.  Nothing returned.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-14 20:15 UTC] bobby at indesignfirm dot com
After more research it would seem that the problem lies within the read function using the mysqli_connect function.  If I change it to mysql_connect, processing continues, changing it back to mysqli_connect causes it to instantly fail with no further information.

However all other mysqli queries are running fine.
 [2009-07-15 12:09 UTC]
Please try using this CVS snapshot:
For Windows:

 [2009-07-29 12:25 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Aug 04 23:01:24 2021 UTC