note 73981 added to function.session-set-save-handler

From: Date: Mon, 19 Mar 2007 18:43:18 +0000
Subject: note 73981 added to function.session-set-save-handler
Groups: php.notes 
Request: Send a blank email to php-notes+get-124595@lists.php.net to get a copy of this message
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? ---- Server IP: 69.147.83.197 Probable Submitter: 89.172.169.225 ---- Manual Page -- http://www.php.net/manual/en/function.session-set-save-handler.php Edit -- https://master.php.net/note/edit/73981 Del: integrated -- https://master.php.net/note/delete/73981/integrated Del: useless -- https://master.php.net/note/delete/73981/useless Del: bad code -- https://master.php.net/note/delete/73981/bad+code Del: spam -- https://master.php.net/note/delete/73981/spam Del: non-english -- https://master.php.net/note/delete/73981/non-english Del: in docs -- https://master.php.net/note/delete/73981/in+docs Del: other reasons-- https://master.php.net/note/delete/73981 Reject -- https://master.php.net/note/reject/73981 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#124595) next »