public function withCookieCollection(CookieCollection $cookies)
    {
        $new = clone $this;
        $values = [];
        foreach ($cookies as $cookie) {
            $values[$cookie->getName()] = $cookie->getValue();
        }
        $new->cookies = $values;

        return $new;
    }
public function withCookieCollection(CookieCollection $cookies)
    {
        $new = clone $this;
        $values = [];
        foreach ($cookies as $cookie) {
            $values[$cookie->getName()] = $cookie->getValue();
        }
        $new->cookies = $values;

        return $new;
    }
public function withCookieCollection ( CookieCollection $ cookies ) { $ new = clone $ this ; $ values = [ ] ; foreach ( $ cookies as $ cookie ) { $ values [ $ cookie -> getName ( ) ] = $ cookie -> getValue ( ) ; } $ new -> cookies = $ values ; return $ new ; }
Replace the cookies in the request with those contained in
the provided CookieCollection.

@param \Cake\Http\Cookie\CookieCollection $cookies The cookie collection
@return static
Replace the cookies in the request with those contained in the provided CookieCollection .