8000 merged branch lancergr/ticket_8460 (PR #8969) · symfony/symfony@1271a4c · GitHub
[go: up one dir, main page]

Skip to content

Commit 1271a4c

Browse files
committed
merged branch lancergr/ticket_8460 (PR #8969)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #8969). Discussion ---------- [HttpFoundation] NativeSessionStorage regenerate | Q | A | ------- DAD0 ------ | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #8460 | License | MIT | Doc PR | Since session_start is called by the regenerate function, then the 'started' flag of NativeSessionStorage have to be set to true. Otherwise, the variable $_SESSION is initiated and the exception "Failed to start the session: already started by PHP ($_SESSION is set)." is thrown. This can be reproduced by clearing the session data (cookies) before authenticating with a method that does not require csrf (eg. using the confirmation link of FOSUserBundle). Commits ------- 7a0eeb3 [HttpFoundation] NativeSessionStorage regenerate
2 parents 68c9c86 + 958ec09 commit 1271a4c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ public function regenerate($destroy = false, $lifetime = null)
217217
} else {
218218
session_start();
219219
}
220+
221+
$this->loadSession();
220222
}
221223

222224
return $ret;

0 commit comments

Comments
 (0)
0