Пример #1
0
 public function extractCookies(RequestInterface $request, ResponseInterface $response)
 {
     if ($cookieHeader = $response->getHeaderAsArray('Set-Cookie')) {
         foreach ($cookieHeader as $cookie) {
             $sc = SetCookie::fromString($cookie);
             if (!$sc->getDomain()) {
                 $sc->setDomain($request->getHost());
             }
             $this->setCookie($sc);
         }
     }
 }