hasSession() public method

This method does not give any information about the state of the session object, like whether the session is started or not. It is just a way to check if this Request is associated with a Session instance.
public hasSession ( ) : boolean
return boolean true when the Request contains a Session object, false otherwise
コード例 #1
1
 /**
  * {@inheritdoc}
  */
 public function getSessionName() : string
 {
     if (null !== $this->getCurrentRequest() && $this->request->hasSession()) {
         return $this->request->getSession()->getName();
     }
     return '';
 }
コード例 #2
1
 /**
  * @param Request $request
  */
 protected function setTargetPath(Request $request)
 {
     // session isn't required when using HTTP basic authentication mechanism for example
     if ($request->hasSession() && $request->isMethodSafe()) {
         $request->getSession()->set('_security.' . $this->providerKey . '.target_path', $request->getUri());
     }
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function collect(Request $request, Response $response, \Exception $exception = null)
 {
     $responseHeaders = $response->headers->all();
     $cookies = array();
     foreach ($response->headers->getCookies() as $cookie) {
         $cookies[] = $this->getCookieHeader($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
     }
     if (count($cookies) > 0) {
         $responseHeaders['Set-Cookie'] = $cookies;
     }
     $attributes = array();
     foreach ($request->attributes->all() as $key => $value) {
         if (is_object($value)) {
             $attributes[$key] = sprintf('Object(%s)', get_class($value));
             if (is_callable(array($value, '__toString'))) {
                 $attributes[$key] .= sprintf(' = %s', (string) $value);
             }
         } else {
             $attributes[$key] = $value;
         }
     }
     $content = null;
     try {
         $content = $request->getContent();
     } catch (\LogicException $e) {
         // the user already got the request content as a resource
         $content = false;
     }
     $this->data = array('format' => $request->getRequestFormat(), 'content' => $content, 'content_type' => $response->headers->get('Content-Type') ? $response->headers->get('Content-Type') : 'text/html', 'status_code' => $response->getStatusCode(), 'request_query' => $request->query->all(), 'request_request' => $request->request->all(), 'request_headers' => $request->headers->all(), 'request_server' => $request->server->all(), 'request_cookies' => $request->cookies->all(), 'request_attributes' => $attributes, 'response_headers' => $responseHeaders, 'session_attributes' => $request->hasSession() ? $request->getSession()->all() : array(), 'flashes' => $request->hasSession() ? $request->getSession()->getFlashBag()->peekAll() : array(), 'path_info' => $request->getPathInfo());
 }
コード例 #4
0
ファイル: Notices.php プロジェクト: KasaiDot/FoolFrame
 /**
  * Sets a flash notice
  *
  * @param  string  $level    The level of the message: success, warning, danger
  * @param  string  $message  The message
  */
 public function setFlash($level, $message)
 {
     if (!$this->request->hasSession()) {
         $this->request->setSession(new Session());
     }
     $this->flash_notices[] = ['level' => $level, 'message' => $message];
     $this->request->getSession()->getFlashBag()->set('notice', $this->flash_notices);
 }
コード例 #5
0
ファイル: RequestHelper.php プロジェクト: pguso/WellCommerce
 /**
  * {@inheritdoc}
  */
 public function getSessionName()
 {
     if (null !== $this->request && $this->request->hasSession()) {
         return $this->request->getSession()->getName();
     }
     return '';
 }
コード例 #6
0
    /**
     * {@inheritdoc}
     */
    public function collect(Request $request, Response $response, \Exception $exception = null)
    {
        $responseHeaders = $response->headers->all();
        $cookies = array();
        foreach ($response->headers->getCookies() as $cookie) {
            $cookies[] = $this->getCookieHeader($cookie->getName(), $cookie->getValue(), $cookie->getExpire(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
        }
        if (count($cookies) > 0) {
            $responseHeaders['Set-Cookie'] = $cookies;
        }

        $attributes = array();
        foreach ($request->attributes->all() as $key => $value) {
            $attributes[$key] = is_object($value) ? sprintf('Object(%s)', get_class($value)) : $value;
        }

        $this->data = array(
            'format'             => $request->getRequestFormat(),
            'content_type'       => $response->headers->get('Content-Type') ? $response->headers->get('Content-Type') : 'text/html',
            'status_code'        => $response->getStatusCode(),
            'request_query'      => $request->query->all(),
            'request_request'    => $request->request->all(),
            'request_headers'    => $request->headers->all(),
            'request_server'     => $request->server->all(),
            'request_cookies'    => $request->cookies->all(),
            'request_attributes' => $attributes,
            'response_headers'   => $responseHeaders,
            'session_attributes' => $request->hasSession() ? $request->getSession()->getAttributes() : array(),
        );
    }
コード例 #7
0
ファイル: SessionManger.php プロジェクト: renyunhuang/nodephp
 public function _initNativeSession(Request $request)
 {
     if (!$request->hasSession()) {
         $sesOption = array('cache_limiter' => 'nocache', 'cookie_domain' => 'localhost.com', 'cookie_httponly' => '1', 'cookie_lifetime' => '1800', 'cookie_path' => '/', 'cookie_secure' => '0', 'entropy_file' => '/dev/urandom', 'entropy_length' => '1024', 'gc_divisor' => '100', 'gc_maxlifetime' => '1800', 'gc_probability' => '100', 'hash_bits_per_character' => '4', 'hash_function' => '1', 'name' => 'NODEPHP', 'referer_check' => '', 'serialize_handler' => 'php', 'use_cookies' => '1', 'use_only_cookies' => '1', 'use_trans_sid' => '0', 'upload_progress.enabled' => '1', 'upload_progress.cleanup' => '1', 'upload_progress.prefix' => 'upload_progress_', 'upload_progress.name' => 'PHP_SESSION_UPLOAD_PROGRESS', 'upload_progress.freq' => '1%', 'upload_progress.min-freq' => '1', 'url_rewriter.tags' => 'a=href,area=href,frame=src,form=,fieldset=');
         $session = new Session(new NativeSessionStorage($sesOption, new NativeFileSessionHandler('/tmp;/tmp'), new MetadataBag('nodephp_meta')), new AttributeBag('nodephp_attributes'), new FlashBag('nodephp_flashes'));
         $request->setSession($session);
     }
 }
コード例 #8
0
 /**
  * {@inheritdoc}
  */
 public function collect(Request $request, Response $response, \Exception $exception = null)
 {
     $responseHeaders = $response->headers->all();
     $cookies = array();
     foreach ($response->headers->getCookies() as $cookie) {
         $cookies[] = $this->getCookieHeader($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
     }
     if (count($cookies) > 0) {
         $responseHeaders['Set-Cookie'] = $cookies;
     }
     $attributes = array();
     foreach ($request->attributes->all() as $key => $value) {
         if ('_route' == $key && is_object($value)) {
             $value = $value->getPattern();
         }
         $attributes[$key] = $this->varToString($value);
     }
     $content = null;
     try {
         $content = $request->getContent();
     } catch (\LogicException $e) {
         // the user already got the request content as a resource
         $content = false;
     }
     $sessionMetadata = array();
     $sessionAttributes = array();
     $flashes = array();
     if ($request->hasSession()) {
         $session = $request->getSession();
         if ($session->isStarted()) {
             $sessionMetadata['Created'] = date(DATE_RFC822, $session->getMetadataBag()->getCreated());
             $sessionMetadata['Last used'] = date(DATE_RFC822, $session->getMetadataBag()->getLastUsed());
             $sessionMetadata['Lifetime'] = $session->getMetadataBag()->getLifetime();
             $sessionAttributes = $session->all();
             $flashes = $session->getFlashBag()->peekAll();
         }
     }
     $this->data = array('format' => $request->getRequestFormat(), 'content' => $content, 'content_type' => $response->headers->get('Content-Type') ? $response->headers->get('Content-Type') : 'text/html', 'status_code' => $response->getStatusCode(), 'request_query' => $request->query->all(), 'request_request' => $request->request->all(), 'request_headers' => $request->headers->all(), 'request_server' => $request->server->all(), 'request_cookies' => $request->cookies->all(), 'request_attributes' => $attributes, 'response_headers' => $responseHeaders, 'session_metadata' => $sessionMetadata, 'session_attributes' => $sessionAttributes, 'flashes' => $flashes, 'path_info' => $request->getPathInfo(), 'controller' => 'n/a', 'locale' => $request->getLocale());
     if (isset($this->controllers[$request])) {
         $controller = $this->controllers[$request];
         if (is_array($controller)) {
             try {
                 $r = new \ReflectionMethod($controller[0], $controller[1]);
                 $this->data['controller'] = array('class' => is_object($controller[0]) ? get_class($controller[0]) : $controller[0], 'method' => $controller[1], 'file' => $r->getFilename(), 'line' => $r->getStartLine());
             } catch (\ReflectionException $re) {
                 if (is_callable($controller)) {
                     // using __call or  __callStatic
                     $this->data['controller'] = array('class' => is_object($controller[0]) ? get_class($controller[0]) : $controller[0], 'method' => $controller[1], 'file' => 'n/a', 'line' => 'n/a');
                 }
             }
         } elseif ($controller instanceof \Closure) {
             $this->data['controller'] = 'Closure';
         } else {
             $this->data['controller'] = (string) $controller ?: 'n/a';
         }
         unset($this->controllers[$request]);
     }
 }
コード例 #9
0
 public function testOnKernelResponseWithoutSession()
 {
     $this->securityContext->setToken(new UsernamePasswordToken('test1', 'pass1', 'phpunit'));
     $request = new Request();
     $event = new FilterResponseEvent($this->getMock('Symfony\\Component\\HttpKernel\\HttpKernelInterface'), $request, HttpKernelInterface::MASTER_REQUEST, new Response());
     $listener = new ContextListener($this->securityContext, array(), 'session');
     $listener->onKernelResponse($event);
     $this->assertFalse($request->hasSession());
 }
コード例 #10
0
ファイル: ExceptionListener.php プロジェクト: khelle/EngiShop
 protected function setTargetPath(Request $request)
 {
     if ($request->isXmlHttpRequest()) {
         return;
     }
     if ($request->hasSession() && ($request->isMethodSafe() || $request->get('_route') == 'engishop_front_cart_add')) {
         $request->getSession()->set('_security.' . $this->providerKey . '.target_path', $request->getUri());
     }
 }
コード例 #11
0
 public function loginAction(Request $request)
 {
     if (!$this->hasRole('ROLE_USER')) {
         if ($request->hasSession() && $request->isMethodSafe()) {
             $referer = $request->headers->get('referer');
             if (null !== $referer) {
                 $request->getSession()->set('ddr.gitki.manuallogin.targetpath', $referer);
             }
         }
         throw new AuthenticationException();
     }
     if ($request->hasSession() && $request->isMethodSafe()) {
         $targetPath = $request->getSession()->get('ddr.gitki.manuallogin.targetpath');
         $request->getSession()->remove('ddr.gitki.manuallogin.targetpath');
         if (null !== $targetPath) {
             return $this->redirect($targetPath);
         }
     }
     return $this->redirect($this->generateUrl('ddr_gitki_wiki_file', array('path' => '/index.md')));
 }
コード例 #12
0
ファイル: RequestListener.php プロジェクト: notbrain/symfony
 protected function initializeSession(Request $request, $master)
 {
     if (!$master) {
         return;
     }
     // inject the session object if none is present
     if (null === $request->getSession()) {
         $request->setSession($this->container->get('session'));
     }
     // starts the session if a session cookie already exists in the request...
     if ($request->hasSession()) {
         $request->getSession()->start();
     }
 }
コード例 #13
0
 public function handle(Request $request, $statusCode)
 {
     $runner = new Run();
     $format = $request->getRequestFormat();
     if ('html' == $format) {
         $handler = new PrettyPageHandler();
         $handler->addDataTable('App', ['Controller' => $request->get('_controller'), 'Route' => $request->get('_route'), 'Session' => $request->hasSession(), 'Status' => $this->getCodeWithDescription($statusCode)]);
     } else {
         if ('json' == $format) {
             $handler = new JsonResponseHandler();
         } else {
             $handler = new PlainTextHandler();
         }
     }
     $runner->pushHandler($handler);
     $runner->writeToOutput(false);
     $runner->allowQuit(false);
     $runner->register();
     return $runner;
 }
コード例 #14
0
 public function connectAction(Request $request, $service)
 {
     $redirectUrl = $this->generateUrl('glory_oauth_callback', ['service' => $service], true);
     $ownerMap = $this->get('glory_oauth.ownermap');
     $owner = $ownerMap->getOwner($service);
     $authorizationUrl = $owner->getAuthorizationUrl($redirectUrl, []);
     // Check for a return path and store it before redirect
     if ($request->hasSession()) {
         $targetUrl = $request->get('target');
         $targetUrl = $targetUrl ?: $request->headers->get('Referer');
         if ($targetUrl) {
             //todo: 这里还有一个可能
             /*if(useForward){
                   
               }*/
             $sessionKey = 'glory_oauth.target_path';
             $request->getSession()->set($sessionKey, $targetUrl);
         }
     }
     return $this->redirect($authorizationUrl);
 }
コード例 #15
0
 /**
  *
  * {@inheritdoc}
  *
  */
 public function collect(Request $request, Response $response, \Exception $exception = null)
 {
     $responseHeaders = $response->headers->all();
     $cookies = array();
     foreach ($response->headers->getCookies() as $cookie) {
         $cookies[] = $this->getCookieHeader($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
     }
     if (count($cookies) > 0) {
         $responseHeaders['Set-Cookie'] = $cookies;
     }
     // attributes are serialized and as they can be anything, they need to be converted to strings.
     $attributes = array();
     foreach ($request->attributes->all() as $key => $value) {
         if ('_route' === $key && is_object($value)) {
             $attributes[$key] = $this->varToString($value->getPath());
         } elseif ('_route_params' === $key) {
             // we need to keep route params as an array (see getRouteParams())
             foreach ($value as $k => $v) {
                 $value[$k] = $this->varToString($v);
             }
             $attributes[$key] = $value;
         } else {
             $attributes[$key] = $this->varToString($value);
         }
     }
     $content = null;
     try {
         $content = $request->getContent();
     } catch (\LogicException $e) {
         // the user already got the request content as a resource
         $content = false;
     }
     $sessionMetadata = array();
     $sessionAttributes = array();
     $flashes = array();
     if ($request->hasSession()) {
         $session = $request->getSession();
         if ($session->isStarted()) {
             $sessionMetadata['Created'] = date(DATE_RFC822, $session->getMetadataBag()->getCreated());
             $sessionMetadata['Last used'] = date(DATE_RFC822, $session->getMetadataBag()->getLastUsed());
             $sessionMetadata['Lifetime'] = $session->getMetadataBag()->getLifetime();
             $sessionAttributes = $session->all();
             $flashes = $session->getFlashBag()->peekAll();
         }
     }
     $statusCode = $response->getStatusCode();
     $this->data = array('format' => $request->getRequestFormat(), 'content' => $content, 'content_type' => $response->headers->get('Content-Type', 'text/html'), 'status_text' => isset(Response::$statusTexts[$statusCode]) ? Response::$statusTexts[$statusCode] : '', 'status_code' => $statusCode, 'request_query' => $request->query->all(), 'request_request' => $request->request->all(), 'request_headers' => $request->headers->all(), 'request_server' => $request->server->all(), 'request_cookies' => $request->cookies->all(), 'request_attributes' => $attributes, 'response_headers' => $responseHeaders, 'session_metadata' => $sessionMetadata, 'session_attributes' => $sessionAttributes, 'flashes' => $flashes, 'path_info' => $request->getPathInfo(), 'controller' => 'n/a', 'locale' => $request->getLocale());
     if (isset($this->data['request_headers']['php-auth-pw'])) {
         $this->data['request_headers']['php-auth-pw'] = '******';
     }
     if (isset($this->data['request_server']['PHP_AUTH_PW'])) {
         $this->data['request_server']['PHP_AUTH_PW'] = '******';
     }
     if (isset($this->data['request_request']['_password'])) {
         $this->data['request_request']['_password'] = '******';
     }
     if (isset($this->controllers[$request])) {
         $controller = $this->controllers[$request];
         if (is_array($controller)) {
             try {
                 $r = new \ReflectionMethod($controller[0], $controller[1]);
                 $this->data['controller'] = array('class' => is_object($controller[0]) ? get_class($controller[0]) : $controller[0], 'method' => $controller[1], 'file' => $r->getFileName(), 'line' => $r->getStartLine());
             } catch (\ReflectionException $e) {
                 if (is_callable($controller)) {
                     // using __call or __callStatic
                     $this->data['controller'] = array('class' => is_object($controller[0]) ? get_class($controller[0]) : $controller[0], 'method' => $controller[1], 'file' => 'n/a', 'line' => 'n/a');
                 }
             }
         } elseif ($controller instanceof \Closure) {
             $r = new \ReflectionFunction($controller);
             $this->data['controller'] = array('class' => $r->getName(), 'method' => null, 'file' => $r->getFileName(), 'line' => $r->getStartLine());
         } elseif (is_object($controller)) {
             $r = new \ReflectionClass($controller);
             $this->data['controller'] = array('class' => $r->getName(), 'method' => null, 'file' => $r->getFileName(), 'line' => $r->getStartLine());
         } else {
             $this->data['controller'] = (string) $controller ?: 'n/a';
         }
         unset($this->controllers[$request]);
     }
 }
コード例 #16
0
 public function hasIntent(Request $request)
 {
     return $request->hasSession() && $request->getSession()->has(self::SESSION_INTENT_KEY);
 }
コード例 #17
0
 /**
  * {@inheritdoc}
  */
 public function collect(Request $request, Response $response, \Exception $exception = null)
 {
     $this->data = array('format' => $request->getRequestFormat(), 'content_type' => $response->headers->get('Content-Type') ? $response->headers->get('Content-Type') : 'text/html', 'status_code' => $response->getStatusCode(), 'request_query' => $request->query->all(), 'request_request' => $request->request->all(), 'request_headers' => $request->headers->all(), 'request_server' => $request->server->all(), 'request_cookies' => $request->cookies->all(), 'request_attributes' => $request->attributes->all(), 'response_headers' => $response->headers->all(), 'session_attributes' => $request->hasSession() ? $request->getSession()->getAttributes() : array());
 }
コード例 #18
0
ファイル: Cookie.php プロジェクト: papillon-cendre/d8
 /**
  * {@inheritdoc}
  */
 public function applies(Request $request)
 {
     return $request->hasSession() && $this->sessionConfiguration->hasSession($request);
 }
コード例 #19
0
ファイル: Application.php プロジェクト: blendsdk/blendengine
 protected function initializeSession(Request $request)
 {
     if (!$request->hasSession()) {
         if (!$this->container->isDefined(SessionProviderInterface::class)) {
             $savePath = $this->filesystem->assertFolderWritable($this->rootFolder . '/var/session');
             $this->container->defineSingletonWithInterface(SessionProviderInterface::class, NativeSessionProvider::class, ['save_path' => $savePath]);
         }
         /* @var $provider SessionProviderInterface */
         $provider = $this->container->get(SessionProviderInterface::class);
         $provider->initializeSession($request);
         $this->container->setScalar(SessionInterface::class, $provider->getSession());
     }
 }
コード例 #20
0
 /**
  * @param Request $request
  */
 protected function setTargetPath(Request $request)
 {
     // session isn't required when using HTTP basic authentication mechanism for example
     if ($request->hasSession() && $request->isMethodSafe() && !$request->isXmlHttpRequest()) {
         $this->saveTargetPath($request->getSession(), $this->providerKey, $request->getUri());
     }
 }
コード例 #21
0
 private function startAuthentication(Request $request, AuthenticationException $authException)
 {
     if (null === $this->authenticationEntryPoint) {
         throw $authException;
     }
     if (null !== $this->logger) {
         $this->logger->debug('Calling Authentication entry point');
     }
     // session isn't required when using http basic authentication mechanism for example
     if ($request->hasSession()) {
         $request->getSession()->set('_security.target_path', $request->getUri());
     }
     return $this->authenticationEntryPoint->start($request, $authException);
 }
コード例 #22
0
 public function testHasSession()
 {
     $request = new Request();
     $this->assertFalse($request->hasSession());
     $request->setSession(new Session(new MockArraySessionStorage()));
     $this->assertTrue($request->hasSession());
 }
コード例 #23
0
ファイル: UpdateKernel.php プロジェクト: scratch/gai
 /**
  * Ensures that the session is saved.
  *
  * @param \Symfony\Component\HttpFoundation\Request $request
  *   The incoming request.
  */
 protected function shutdownSession(Request $request)
 {
     if ($request->hasSession()) {
         $request->getSession()->save();
     }
 }
コード例 #24
0
ファイル: ExceptionListener.php プロジェクト: nicodmf/symfony
 protected function setTargetPath(Request $request)
 {
     // session isn't required when using http basic authentication mechanism for example
     if ($request->hasSession()) {
         $request->getSession()->set('_security.target_path', $request->getUri());
     }
 }
コード例 #25
0
 protected function resolveSession(Request $request)
 {
     return $request->hasSession() ? $request->getSession() : new Session();
 }
コード例 #26
0
ファイル: AbstractEngine.php プロジェクト: sitegear/sitegear
 /**
  * Initialise the session.
  *
  * @param Request $request
  *
  * @return Session
  */
 protected function createSession(Request $request)
 {
     if ($request->hasSession()) {
         $session = $request->getSession();
     } else {
         $session = new Session();
         $request->setSession($session);
     }
     $session->setName('sitegear');
     if (!$session->isStarted()) {
         $session->start();
     }
     return $session;
 }
コード例 #27
0
 /**
  * @param Request $request
  * @param string  $service
  *
  * @return RedirectResponse
  */
 public function redirectToServiceAction(Request $request, $service)
 {
     // Check for a specified target path and store it before redirect if present
     $param = $this->container->getParameter('hwi_oauth.target_path_parameter');
     if ($request->hasSession()) {
         // initialize the session for preventing SessionUnavailableException
         $session = $request->getSession();
         $session->start();
         if (!empty($param) && ($targetUrl = $request->get($param, null, true))) {
             $providerKey = $this->container->getParameter('hwi_oauth.firewall_name');
             $request->getSession()->set('_security.' . $providerKey . '.target_path', $targetUrl);
         }
     }
     return new RedirectResponse($this->container->get('hwi_oauth.security.oauth_utils')->getAuthorizationUrl($request, $service));
 }
コード例 #28
0
 public function testGetSession()
 {
     $request = new Request();
     $request->setSession(new Session(new MockArraySessionStorage()));
     $this->assertTrue($request->hasSession());
     $session = $request->getSession();
     $this->assertObjectHasAttribute('storage', $session);
     $this->assertObjectHasAttribute('flashName', $session);
     $this->assertObjectHasAttribute('attributeName', $session);
 }
コード例 #29
0
 /**
  * {@inheritdoc}
  */
 public function collect(Request $request, Response $response, \Exception $exception = null)
 {
     $responseHeaders = $response->headers->all();
     $cookies = array();
     foreach ($response->headers->getCookies() as $cookie) {
         $cookies[] = $this->getCookieHeader($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
     }
     if (count($cookies) > 0) {
         $responseHeaders['Set-Cookie'] = $cookies;
     }
     // attributes are serialized and as they can be anything, they need to be converted to strings.
     $attributes = array();
     $route = '';
     foreach ($request->attributes->all() as $key => $value) {
         if ('_route' === $key && is_object($value)) {
             $attributes[$key] = $this->cloneVar($value->getPath());
         } else {
             $attributes[$key] = $this->cloneVar($value);
         }
         if ('_route' === $key) {
             $route = is_object($value) ? $value->getPath() : $value;
         }
     }
     $content = null;
     try {
         $content = $request->getContent();
     } catch (\LogicException $e) {
         // the user already got the request content as a resource
         $content = false;
     }
     $sessionMetadata = array();
     $sessionAttributes = array();
     $session = null;
     $flashes = array();
     if ($request->hasSession()) {
         $session = $request->getSession();
         if ($session->isStarted()) {
             $sessionMetadata['Created'] = date(DATE_RFC822, $session->getMetadataBag()->getCreated());
             $sessionMetadata['Last used'] = date(DATE_RFC822, $session->getMetadataBag()->getLastUsed());
             $sessionMetadata['Lifetime'] = $session->getMetadataBag()->getLifetime();
             $sessionAttributes = $session->all();
             $flashes = $session->getFlashBag()->peekAll();
         }
     }
     $statusCode = $response->getStatusCode();
     $this->data = array('method' => $request->getMethod(), 'format' => $request->getRequestFormat(), 'content' => $content, 'content_type' => $response->headers->get('Content-Type', 'text/html'), 'status_text' => isset(Response::$statusTexts[$statusCode]) ? Response::$statusTexts[$statusCode] : '', 'status_code' => $statusCode, 'request_query' => array_map(array($this, 'cloneVar'), $request->query->all()), 'request_request' => array_map(array($this, 'cloneVar'), $request->request->all()), 'request_headers' => $request->headers->all(), 'request_server' => $request->server->all(), 'request_cookies' => $request->cookies->all(), 'request_attributes' => $attributes, 'route' => $route, 'response_headers' => $responseHeaders, 'session_metadata' => $sessionMetadata, 'session_attributes' => $sessionAttributes, 'flashes' => $flashes, 'path_info' => $request->getPathInfo(), 'controller' => 'n/a', 'locale' => $request->getLocale());
     if (isset($this->data['request_headers']['php-auth-pw'])) {
         $this->data['request_headers']['php-auth-pw'] = '******';
     }
     if (isset($this->data['request_server']['PHP_AUTH_PW'])) {
         $this->data['request_server']['PHP_AUTH_PW'] = '******';
     }
     if (isset($this->data['request_request']['_password'])) {
         $this->data['request_request']['_password'] = '******';
     }
     if (isset($this->controllers[$request])) {
         $this->data['controller'] = $this->parseController($this->controllers[$request]);
         unset($this->controllers[$request]);
     }
     if (null !== $session && $session->isStarted()) {
         if ($request->attributes->has('_redirected')) {
             $this->data['redirect'] = $session->remove('sf_redirect');
         }
         if ($response->isRedirect()) {
             $session->set('sf_redirect', array('token' => $response->headers->get('x-debug-token'), 'route' => $request->attributes->get('_route', 'n/a'), 'method' => $request->getMethod(), 'controller' => $this->parseController($request->attributes->get('_controller')), 'status_code' => $statusCode, 'status_text' => Response::$statusTexts[(int) $statusCode]));
         }
     }
 }