public function onSiteAccessMatch(PostSiteAccessMatchEvent $event)
 {
     if (!($event->getRequestType() === HttpKernelInterface::MASTER_REQUEST && isset($this->session) && !$this->session->isStarted() && $this->sessionStorage instanceof NativeSessionStorage)) {
         return;
     }
     $sessionOptions = (array) $this->configResolver->getParameter('session');
     $sessionName = isset($sessionOptions['name']) ? $sessionOptions['name'] : $this->session->getName();
     $sessionOptions['name'] = $this->getSessionName($sessionName, $event->getSiteAccess());
     $this->sessionStorage->setOptions($sessionOptions);
 }
 public function setOptions( array $options )
 {
     if ( $this->innerSessionStorage instanceof NativeSessionStorage )
     {
         $this->innerSessionStorage->setOptions( $options );
     }
 }
 /**
  * Let Symfony starts the session
  *
  * @return bool
  */
 public function sessionStart()
 {
     if ($this->storage && !$this->storage->isStarted()) {
         $this->storage->start();
     }
     return true;
 }
 public function logout(Request $request)
 {
     $response = new Response();
     // Manually clear the session through session storage.
     // Session::invalidate() is not called on purpose, to avoid unwanted session migration that would imply
     // generation of a new session id.
     // REST logout must indeed clear the session cookie.
     // See \eZ\Publish\Core\REST\Server\Security\RestLogoutHandler
     $this->sessionStorage->clear();
     $token = $this->tokenStorage->getToken();
     foreach ($this->logoutHandlers as $handler) {
         // Explicitly ignore SessionLogoutHandler as we do session invalidation manually here,
         // through the session storage, to avoid unwanted session migration.
         if ($handler instanceof SessionLogoutHandler) {
             continue;
         }
         $handler->logout($request, $response, $token);
     }
     return $response;
 }
Exemple #5
0
 /**
  * {@iheritdoc}
  */
 public function getBag($name)
 {
     return $this->storage->getBag($name);
 }
Exemple #6
0
 /**
  * Returns the number of attributes.
  *
  * @return int The number of attributes
  */
 public function count()
 {
     return count($this->storage->getBag('attributes')->all());
 }
 /**
  * @inheritdoc
  */
 public function getMetadataBag()
 {
     $this->replaceSessionId();
     return $this->decorated->getMetadataBag();
 }