xref: /PHP-8.2/ext/session/tests/gh9584.phpt (revision 3071d85a)
1--TEST--
2GH-9584: PS(mod_user_class_name) must not leak into next request
3--EXTENSIONS--
4session
5--SKIPIF--
6<?php include('skipif.inc'); ?>
7--FILE--
8<?php
9
10class MySessionHandler extends SessionHandler implements SessionUpdateTimestampHandlerInterface
11{
12    public function open($path, $sessname): bool {
13        return true;
14    }
15
16    public function close(): bool {
17        return true;
18    }
19
20    public function read($sessid): string|false {
21        return 'foo|s:3:"foo";';
22    }
23
24    public function write($sessid, $sessdata): bool {
25        return false;
26    }
27
28    public function destroy($sessid): bool {
29        return true;
30    }
31
32    public function gc($maxlifetime): int|false {
33        return true;
34    }
35
36    public function create_sid(): string {
37        return sha1(random_bytes(32));
38    }
39
40    public function validateId($sid): bool {
41        return true;
42    }
43
44    public function updateTimestamp($sessid, $sessdata): bool {
45        return false;
46    }
47}
48
49$handler = new MySessionHandler();
50session_set_save_handler($handler);
51
52?>
53===DONE===
54--EXPECT--
55===DONE===
56