You are here

protected function SecuredRedirectResponse::fromResponse in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Component/HttpFoundation/SecuredRedirectResponse.php \Drupal\Component\HttpFoundation\SecuredRedirectResponse::fromResponse()

Copies over the values from the given response.

Parameters

\Symfony\Component\HttpFoundation\RedirectResponse $response: The redirect reponse object.

1 call to SecuredRedirectResponse::fromResponse()
CacheableSecuredRedirectResponse::fromResponse in core/lib/Drupal/Core/Routing/CacheableSecuredRedirectResponse.php
Copies over the values from the given response.
1 method overrides SecuredRedirectResponse::fromResponse()
CacheableSecuredRedirectResponse::fromResponse in core/lib/Drupal/Core/Routing/CacheableSecuredRedirectResponse.php
Copies over the values from the given response.

File

core/lib/Drupal/Component/HttpFoundation/SecuredRedirectResponse.php, line 46
Contains \Drupal\Component\HttpFoundation\SecuredRedirectResponse.

Class

SecuredRedirectResponse
Provides a common base class for safe redirects.

Namespace

Drupal\Component\HttpFoundation

Code

protected function fromResponse(RedirectResponse $response) {
  $this
    ->setProtocolVersion($response
    ->getProtocolVersion());
  $this
    ->setCharset($response
    ->getCharset());

  // Cookies are separate from other headers and have to be copied over
  // directly.
  foreach ($response->headers
    ->getCookies() as $cookie) {
    $this->headers
      ->setCookie($cookie);
  }
}