note 84739 deleted from function.session-set-save-handler by drak
| From: | drak@php.net | Date: | Sun, 11 Mar 2012 04:28:53 +0000 |
| Subject: | note 84739 deleted from function.session-set-save-handler by drak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-186589@lists.php.net to get a copy of this message | ||
Note Submitter: bob at nospam dot com
----
If using mysqli in procedural style you may expect the mysqli handle to be valid in the write
callback. It is not the case, the handle in procedural style is a object that will be destroy unlink
the plain mysql interface handle. Just register a shutdown function after set save handler like
this:
session_set_save_handler('_session_open', '_session_close',
'_session_read', '_session_write', '_session_destroy',
'_session_gc');
register_shutdown_function('session_write_close');
Since PHP 4.1, it more of a PRE-Shutdown and it fix the issue for me.