Created
May 9, 2013 21:02
-
-
Save daum/5550602 to your computer and use it in GitHub Desktop.
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
<?php | |
namespace Setfive\DemoBundle\Listener; | |
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; | |
use Symfony\Component\Security\Http\Event\SwitchUserEvent; | |
class LoginListener | |
{ | |
/** | |
* Fired on switch user, you can remove attributes or whatever you want here. | |
* @param SwitchUserEvent $event | |
*/ | |
public function onSecuritySwitchUser(SwitchUserEvent $event) | |
{ | |
$session = $event->getRequest()->getSession(); | |
$session->remove('partThatShouldNotCarryOver'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment