src/Http/Response.php
public function cookies($request)
    {
        $headers = $response->headers();
        if (!isset($headers['Set-Cookie'])) {
            return [];
        }
        $setCookies = [];
        foreach ($headers['Set-Cookie'] as $setCookieHeader) {
            $setCookie = Cookie::fromString($setCookieHeader);
            if (!$setCookie->domain()) {
                $setCookie->domain($request->hostname());
            }
            if (strpos($setCookie->path(), '/') !== 0) {
                $setCookie->path($this->_pathFrom($request));
            }
            $setCookies[] = $setCookie;
        }
        return $setCookies;
    }
public function cookies($request)
    {
        $headers = $response->headers();
        if (!isset($headers['Set-Cookie'])) {
            return [];
        }
        $setCookies = [];
        foreach ($headers['Set-Cookie'] as $setCookieHeader) {
            $setCookie = Cookie::fromString($setCookieHeader);
            if (!$setCookie->domain()) {
                $setCookie->domain($request->hostname());
            }
            if (strpos($setCookie->path(), '/') !== 0) {
                $setCookie->path($this->_pathFrom($request));
            }
            $setCookies[] = $setCookie;
        }
        return $setCookies;
    }
public function cookies ( $ request ) { $ headers = $ response -> headers ( ) ; if ( ! isset ( $ headers [ 'Set-Cookie' ] ) ) { return [ ] ; } $ setCookies = [ ] ; foreach ( $ headers [ 'Set-Cookie' ] as $ setCookieHeader ) { $ setCookie = Cookie :: fromString ( $ setCookieHeader ) ; if ( ! $ setCookie -> domain ( ) ) { $ setCookie -> domain ( $ request -> hostname ( ) ) ; } if ( strpos ( $ setCookie -> path ( ) , '/' ) !== 0 ) { $ setCookie -> path ( $ this -> _pathFrom ( $ request ) ) ; } $ setCookies [ ] = $ setCookie ; } return $ setCookies ; }
Extract cookies.

@return array The cookies array.
Extract cookies .