Re: PHP 7.0.3 RC1 is available for testing - **** BC break ***

From: Date: Fri, 22 Jan 2016 10:38:19 +0000
Subject: Re: PHP 7.0.3 RC1 is available for testing - **** BC break ***
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-90827@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Reproducer attached It seems that using a user land SessionHandler, the "write" method is not called, raising this issue. Remi. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlaiBpgACgkQYUppBSnxahjMWACdHM/uJv8lVOSbTAUJT+rwWsC3 rcUAn1Mzd+n11xpuDI4bY5DIcqtt/Pu7 =Drkk -----END PGP SIGNATURE-----

<?php class MySessionHandler implements SessionHandlerInterface { private $tab; public function __construct () { var_dump(__METHOD__); $this->tab = array(); } public function close () { var_dump(__METHOD__); return true; } public function destroy ($session_id) { var_dump(__METHOD__, $session_id); unset($this->tab[$session_id]); return true; } public function gc ($maxlifetime) { var_dump(__METHOD__, $maxlifetime); return true; } public function open ($save_path, $name) { var_dump(__METHOD__, $save_path, $name); return true; } public function read($session_id) { var_dump(__METHOD__, $session_id); return (isset($this->tab[$session_id]) ? $this->tab[$session_id] : ''); } public function write ($session_id, $session_data) { var_dump(__METHOD__, $session_id, $session_data); $this->tab[$session_id] = $session_data; return true; } } ini_set('session.save_path', '/tmp'); $handler = new MySessionHandler(); session_set_save_handler($handler, true); // Write session_name('sessionname'); session_id('sessionid'); session_start(); $_SESSION['sessiondata'] = 'foo'; session_write_close(); // Reopen session_write_close(); session_name('sessionname'); session_id('sessionid'); session_start(); var_dump($_SESSION);
« previous php.internals (#90827) next »