Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security] refactored remember-me code
- Loading branch information
1 parent
129d7c7
commit 3d97638
Showing
14 changed files
with
265 additions
and
596 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Symfony\Bundle\SecurityBundle; | ||
|
||
use Symfony\Component\EventDispatcher\EventInterface; | ||
use Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface; | ||
|
||
/** | ||
* Adds remember-me cookies to the Response. | ||
* | ||
* @author Johannes M. Schmitt <schmittjoh@gmail.com> | ||
*/ | ||
class ResponseListener | ||
{ | ||
public function handle(EventInterface $event) | ||
{ | ||
$request = $event->get('request'); | ||
if (!$request->attributes->has(RememberMeServicesInterface::COOKIE_ATTR_NAME)) { | ||
return; | ||
} | ||
|
||
$event->get('response')->headers->setCookie($request->attributes->get(RememberMeServicesInterface::COOKIE_ATTR_NAME)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.