PHP Class Contao\CoreBundle\EventListener\UserSessionListener

Inheritance: use trait Contao\CoreBundle\Framework\ScopeAwareTrait
Mostra file Open project: contao/core-bundle Class Usage Examples

Protected Properties

Property Type Description
$tokenStorage Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface

Public Methods

Method Description
__construct ( Symfony\Component\HttpFoundation\Session\SessionInterface $session, Doctrine\DBAL\Connection $connection, Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface $tokenStorage, Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface $authenticationTrustResolver ) Constructor.
onKernelRequest ( GetResponseEvent $event ) Replaces the current session data with the stored session data.
onKernelResponse ( FilterResponseEvent $event ) Writes the current session data to the database.

Private Methods

Method Description
getSessionBag ( ) : Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface Returns the session bag.
getUserObject ( ) : FrontendUser | BackendUser | null Returns the user object depending on the container scope.

Method Details

__construct() public method

Constructor.
public __construct ( Symfony\Component\HttpFoundation\Session\SessionInterface $session, Doctrine\DBAL\Connection $connection, Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface $tokenStorage, Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface $authenticationTrustResolver )
$session Symfony\Component\HttpFoundation\Session\SessionInterface
$connection Doctrine\DBAL\Connection
$tokenStorage Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface
$authenticationTrustResolver Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface

onKernelRequest() public method

Replaces the current session data with the stored session data.
public onKernelRequest ( GetResponseEvent $event )
$event Symfony\Component\HttpKernel\Event\GetResponseEvent

onKernelResponse() public method

Writes the current session data to the database.
public onKernelResponse ( FilterResponseEvent $event )
$event Symfony\Component\HttpKernel\Event\FilterResponseEvent

Property Details

$tokenStorage protected_oe property

protected TokenStorageInterface,Symfony\Component\Security\Core\Authentication\Token\Storage $tokenStorage
return Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface