File tree 2 files changed +23
-1
lines changed
tests/system/Session/Handlers/Database
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ public function close(): bool
223
223
224
224
if (($ pingReply === true ) || ($ pingReply === '+PONG ' )) {
225
225
if (isset ($ this ->lockKey )) {
226
- $ this ->redis -> del ( $ this -> lockKey );
226
+ $ this ->releaseLock ( );
227
227
}
228
228
229
229
if (! $ this ->redis ->close ()) {
Original file line number Diff line number Diff line change @@ -168,4 +168,26 @@ public function testGC(): void
168
168
$ handler = $ this ->getInstance ();
169
169
$ this ->assertSame (1 , $ handler ->gc (3600 ));
170
170
}
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
+ }
171
193
}
You can’t perform that action at this time.
0 commit comments