SecuredRedirectResponse::fromResponse

protected SecuredRedirectResponse::fromResponse(RedirectResponse $response)

Copies over the values from the given response.

Parameters

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

File

core/lib/Drupal/Component/HttpFoundation/SecuredRedirectResponse.php, line 41

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);
  }
}
doc_Drupal
2016-10-29 09:40:59
Comments
Leave a Comment

Please login to continue.