Skip to content

Commit 47e08d2

Browse files
committed
fix: destory old session
CSRF token is updated before session regeneration, so same-site attakcers may get the new CSRF token. To prevent it, delete the old session.
1 parent 835bec6 commit 47e08d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Authentication/Authenticators/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ public function startLogin(User $user): void
567567

568568
// Regenerate the session ID to help protect against session fixation
569569
if (ENVIRONMENT !== 'testing') {
570-
session()->regenerate();
570+
session()->regenerate(true);
571571
}
572572

573573
// Let the session know we're logged in

0 commit comments

Comments
 (0)