8000 Bugfix for creating cookie on loginSuccess in AbstractRememberMeServices · symfony/symfony@373be62 · GitHub
[go: up one dir, main page]

Skip to content

Commit 373be62

Browse files
author
Terje Bråten
committed
Bugfix for creating cookie on loginSuccess in AbstractRememberMeServices
1 parent 50a62da commit 373be62

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ final public function loginSuccess(Request $request, Response $response, TokenIn
195195
$this->logger->debug('Remember-me was requested; setting cookie.');
196196
}
197197

198+
// Remove attribute from request that sets a NULL cookie.
199+
// It was set by $this->cancelCookie()
200+
// (cancelCookie does other things too for some RememberMeServices
201+
// so we should still call it at the start of this method)
202+
$request->attributes->remove(self::COOKIE_ATTR_NAME);
203+
198204
$this->onLoginSuccess($request, $response, $token);
199205
}
200206

src/Symfony/Component/Security/Http/RememberMe/PersistentTokenBasedRememberMeServices.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ protected function onLoginSuccess(Request $request, Response $response, TokenInt
133133
)
134134
);
135135

136-
$request->attributes->remove(self::COOKIE_ATTR_NAME);
137136
$response->headers->setCookie(
138137
new Cookie(
139138
$this->options['name'],

0 commit comments

Comments
 (0)
0