File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
tests/system/Session/Handlers/Database Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -168,4 +168,26 @@ public function testGC(): void
168168 $ handler = $ this ->getInstance ();
169169 $ this ->assertSame (1 , $ handler ->gc (3600 ));
170170 }
171+
172+ /**
173+ * See https://github.com/codeigniter4/CodeIgniter4/issues/7695
174+ */
175+ public function testSecondaryReadAfterClose (): void
176+ {
177+ $ handler = $ this ->getInstance ();
178+ $ handler ->open ($ this ->sessionSavePath , $ this ->sessionName );
179+
180+ $ expected = <<<'DATA'
181+ __ci_last_regenerate|i:1664607454;_ci_previous_url|s:32:"http://localhost:8080/index.php/";key|s:5:"value";
182+ DATA;
183+ $ this ->assertSame ($ expected , $ handler ->read ('555556b43phsnnf8if6bo33b635e4447 ' ));
184+
185+ $ handler ->close ();
186+
187+ $ handler ->open ($ this ->sessionSavePath , $ this ->sessionName );
188+
189+ $ this ->assertSame ($ expected , $ handler ->read ('555556b43phsnnf8if6bo33b635e4447 ' ));
190+
191+ $ handler ->close ();
192+ }
171193}
You can’t perform that action at this time.
0 commit comments