diff options
author | Yasuo Ohgaki <yohgaki@php.net> | 2016-01-16 05:29:06 +0900 |
---|---|---|
committer | Yasuo Ohgaki <yohgaki@php.net> | 2016-01-16 05:29:19 +0900 |
commit | 9f2240963f75aa1d15c3ae2485e61635ec2c24fa (patch) | |
tree | 31db48f8ca2b1b02509a264f70f4410f4127ac9b /ext/session/tests/bug70133.phpt | |
parent | 93db2dac48bc9e49c4f44882b27d5ab71a5c2d05 (diff) | |
download | php-git-9f2240963f75aa1d15c3ae2485e61635ec2c24fa.tar.gz |
Add test for Bug #70133 (Extended SessionHandler::read is ignoring $session_id when calling parent)
Diffstat (limited to 'ext/session/tests/bug70133.phpt')
-rw-r--r-- | ext/session/tests/bug70133.phpt | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/ext/session/tests/bug70133.phpt b/ext/session/tests/bug70133.phpt new file mode 100644 index 0000000000..3e019e483b --- /dev/null +++ b/ext/session/tests/bug70133.phpt @@ -0,0 +1,41 @@ +--TEST-- +Bug #70133 (Extended SessionHandler::read is ignoring $session_id when calling parent) +--SKIPIF-- +<?php include('skipif.inc'); ?> +--INI-- +session.save_handler=files +session.save_path= +session.use_strict_mode=0 +--FILE-- +<?php + +class CustomReadHandler extends \SessionHandler { + + public function read($session_id) { + return parent::read('mycustomsession'); + } +} + +ob_start(); + +session_set_save_handler(new CustomReadHandler(), true); + +session_id('mycustomsession'); +session_start(); +$_SESSION['foo'] = 'hoge'; +var_dump(session_id()); +session_commit(); + +session_id('otherid'); +session_start(); +var_dump($_SESSION); +var_dump(session_id()); + +?> +--EXPECT-- +string(15) "mycustomsession" +array(1) { + ["foo"]=> + string(4) "hoge" +} +string(7) "otherid" |