Hi Remi,
On Mon, Jan 25, 2016 at 11:47 AM, Yasuo Ohgaki <[email protected]> wrote:
>
> On Fri, Jan 22, 2016 at 7:38 PM, Remi Collet <[email protected]> wrote:
>>
>> It seems that using a user land SessionHandler, the "write" method is
>> not called, raising this issue.
>
> Thank you. I'll check it soon. (in a few days)
Thank you for the script.
I've tried and checked the output, but it seems OK to me.
It call open->read->write->close, twice.
--------------------------------------------------------
// Write
session_name('sessionname');
session_id('sessionid');
session_start(); // This should call open/read
$_SESSION['sessiondata'] = 'foo';
session_write_close(); // This should call write/close
echo '------------------'.PHP_EOL;
// Reopen
session_write_close();
// Copy & paste error? Does not need this line and should not
// call handlers while session is not active. Otherwise,
// something wrong could happen.
session_name('sessionname');
session_id('sessionid');
session_start(); // This should call open/read
var_dump($_SESSION);
// Shutdown should call write/close
--------------------------------------------------------
As I add comments in code, session_write_close() should not do
anything but the test script assumes write/close is called?
I've tested with Fedora 23's PHP 5.6.17 and got the expected result
--------------------------------------------------------
"MySessionHandler::__construct"
string(22) "MySessionHandler::open"
string(4) "/tmp"
string(11) "sessionname"
string(22) "MySessionHandler::read"
string(9) "sessionid"
string(23) "MySessionHandler::write"
string(9) "sessionid"
string(22) "sessiondata|s:3:"foo";"
string(23) "MySessionHandler::close"
------------------
string(22) "MySessionHandler::open"
string(4) "/tmp"
string(11) "sessionname"
string(22) "MySessionHandler::read"
string(9) "sessionid"
array(1) {
["sessiondata"]=>
string(3) "foo"
}
string(23) "MySessionHandler::write"
string(9) "sessionid"
string(22) "sessiondata|s:3:"foo";"
string(23) "MySessionHandler::close"
--------------------------------------------------------
Could you give more details or other test script?
Thank you!
--
Yasuo Ohgaki
[email protected]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php