summaryrefslogtreecommitdiff
path: root/ext/session/tests/bug70133.phpt
blob: 3e019e483baf27991a824079afa72492d70ab193 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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"