#38854 [Opn->WFx]: Can't access database in custom session handler with MySQLi
| From: | mike@php.net | Date: | Sat, 16 Sep 2006 17:30:38 +0000 |
| Subject: | #38854 [Opn->WFx]: Can't access database in custom session handler with MySQLi | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-102282@lists.php.net to get a copy of this message | ||
ID: 38854
Updated by: mike@php.net
Reported By: thbley at gmail dot com
-Status: Open
+Status: Wont fix
Bug Type: MySQLi related
Operating System: Win32 / XP SP2
PHP Version: 5.1.6
New Comment:
Objects are destroyed before the session is written.
You may call session_write_close() prior shutdown.
Previous Comments:
------------------------------------------------------------------------
[2006-09-16 16:43:58] thbley at gmail dot com
Description:
------------
MySQLi connection is broken when using a custom session handler. When
using MySQL extension there is no problem.
Reproduce code:
---------------
<?php
$GLOBALS["DB"] = mysqli_connect("localhost","root","");
session_set_save_handler("_login_session_none","_login_session_none","_login_session_none","_login_session_write","_login_session_none","_login_session_none");
session_start();
echo mysqli_query($GLOBALS["DB"],"show status")."OK\n";
function _login_session_none($param1="", $param2="") {
return true;
}
function _login_session_write($id,$val) {
echo mysqli_query($GLOBALS["DB"],"show status");
}
?>
Expected result:
----------------
Object id #2OK
Object id #2O
Actual result:
--------------
Object id #2OK
Warning: mysqli_query() [function.mysqli-query]: Couldn't fetch mysqli
in H:\sgs\src\test_mysqli.php on line 14
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38854&edit=1