note 73981 rejected from function.session-set-save-handler by nlopess
| From: | nlopess@php.net | Date: | Mon, 19 Mar 2007 20:09:16 +0000 |
| Subject: | note 73981 rejected from function.session-set-save-handler by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-124600@lists.php.net to get a copy of this message | ||
Note Submitter: Void
----
It appears to me that using MySQLi and database sessions is a bit nonsensical in PHP 5 +. One of the
important reasons of using MySQLi in object oriented form is to extend default classes to manage
errors (and other things, aside to param and result binding and prepared statements), especially
since PHP does not report MySQL errors through default error handler.
What happens is that your MySQLi class is unavailable in write session handler, so you can't
store data.
One way to solve this is to call session_write_close() explicitly at the end of your script (not
from your Mysqli class destructor). Another is to use procedural style Mysqli functions in session
handlers, but then you won't have MySQL error handling, if your classes provided that.
Or am I missing something?