File tree Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,11 @@ static inline void php_rshutdown_session_globals(void) /* {{{ */
142
142
PS (session_vars ) = NULL ;
143
143
}
144
144
145
+ if (PS (mod_user_class_name )) {
146
+ zend_string_release (PS (mod_user_class_name ));
147
+ PS (mod_user_class_name ) = NULL ;
148
+ }
149
+
145
150
/* User save handlers may end up directly here by misuse, bugs in user script, etc. */
146
151
/* Set session status to prevent error while restoring save handler INI value. */
147
152
PS (session_status ) = php_session_none ;
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-9584: PS(mod_user_class_name) must not leak into next request
3
+ --EXTENSIONS--
4
+ session
5
+ --SKIPIF--
6
+ <?php include ('skipif.inc ' ); ?>
7
+ --FILE--
8
+ <?php
9
+
10
+ class 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 ();
50
+ session_set_save_handler ($ handler );
51
+
52
+ ?>
53
+ ===DONE===
54
+ --EXPECT--
55
+ ===DONE===
You can’t perform that action at this time.
0 commit comments