Skip to content

Instantly share code, notes, and snippets.

@daum
Created May 9, 2013 21:02
Show Gist options
  • Save daum/5550602 to your computer and use it in GitHub Desktop.
Save daum/5550602 to your computer and use it in GitHub Desktop.
<?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