Skip to content

Commit 75bd663

Browse files
Merge branch '4.4' into 5.4
* 4.4: [HttpFoundation] Fix session tests Bump Symfony version to 4.4.48 Update VERSION for 4.4.47 Update CONTRIBUTORS for 4.4.47 Update CHANGELOG for 4.4.47
2 parents e7c7b39 + cd4f478 commit 75bd663

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

Tests/Session/Storage/Handler/Fixtures/common.inc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ ob_start();
5454
class TestSessionHandler extends AbstractSessionHandler
5555
{
5656
private $data;
57+
private $sessionId;
5758

58-
public function __construct($data = '')
59+
public function __construct($data = '', $sessionId = null)
5960
{
6061
$this->data = $data;
62+
$this->sessionId = $sessionId;
6163
}
6264

6365
public function open($path, $name): bool
@@ -131,21 +133,29 @@ class TestSessionHandler extends AbstractSessionHandler
131133

132134
protected function doRead($sessionId): string
133135
{
134-
echo __FUNCTION__.': ', $this->data, "\n";
136+
if (isset($this->sessionId) && $sessionId !== $this->sessionId) {
137+
echo __FUNCTION__ . ": invalid sessionId\n";
138+
139+
return '';
140+
}
141+
echo __FUNCTION__ . ': ', $this->data, "\n";
142+
$this->sessionId = $sessionId;
135143

136144
return $this->data;
137145
}
138146

139147
protected function doWrite($sessionId, $data): bool
140148
{
141149
echo __FUNCTION__.': ', $data, "\n";
150+
$this->sessionId = $sessionId;
142151

143152
return true;
144153
}
145154

146155
protected function doDestroy($sessionId): bool
147156
{
148157
echo __FUNCTION__, "\n";
158+
$this->sessionId = '';
149159

150160
return true;
151161
}

Tests/Session/Storage/Handler/Fixtures/regenerate.expected

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ close
99
open
1010
validateId
1111
read
12-
doRead: abc|i:123;
12+
doRead: invalid sessionId
1313
read
14-
doRead: abc|i:123;
1514

1615
write
1716
doWrite: abc|i:123;

Tests/Session/Storage/Handler/Fixtures/with_samesite_and_migration.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ close
88
open
99
validateId
1010
read
11-
doRead:
11+
doRead: invalid sessionId
1212
read
1313

1414
write

0 commit comments

Comments
 (0)