protected function encodeSetCookieHeader(ResponseInterface $response)
    {
        $cookies = CookieCollection::createFromHeader($response->getHeader('Set-Cookie'));
        $header = [];
        foreach ($cookies as $cookie) {
            if (in_array($cookie->getName(), $this->cookieNames, true)) {
                $value = $this->_encrypt($cookie->getValue(), $this->cipherType);
                $cookie = $cookie->withValue($value);
            }
            $header[] = $cookie->toHeaderValue();
        }

        return $response->withHeader('Set-Cookie', $header);
    }
protected function encodeSetCookieHeader(ResponseInterface $response)
    {
        $cookies = CookieCollection::createFromHeader($response->getHeader('Set-Cookie'));
        $header = [];
        foreach ($cookies as $cookie) {
            if (in_array($cookie->getName(), $this->cookieNames, true)) {
                $value = $this->_encrypt($cookie->getValue(), $this->cipherType);
                $cookie = $cookie->withValue($value);
            }
            $header[] = $cookie->toHeaderValue();
        }

        return $response->withHeader('Set-Cookie', $header);
    }
protected function encodeSetCookieHeader ( ResponseInterface $ response ) { $ cookies = CookieCollection :: createFromHeader ( $ response -> getHeader ( 'Set-Cookie' ) ) ; $ header = [ ] ; foreach ( $ cookies as $ cookie ) { if ( in_array ( $ cookie -> getName ( ) , $ this -> cookieNames , true ) ) { $ value = $ this -> _encrypt ( $ cookie -> getValue ( ) , $ this -> cipherType ) ; $ cookie = $ cookie -> withValue ( $ value ) ; } $ header [ ] = $ cookie -> toHeaderValue ( ) ; } return $ response -> withHeader ( 'Set-Cookie' , $ header ) ; }
Encode cookies from a response's Set-Cookie header

@param \Psr\Http\Message\ResponseInterface $response The response to encode cookies in.
@return \Psr\Http\Message\ResponseInterface Updated response with encoded cookies.
Encode cookies from a response s Set - Cookie header