cookieJar = new CookieJar(); $this->client = new Client([ 'base_url' => $this->base_url, 'defaults' => [ 'cookies' => $this->cookieJar, 'headers' => [ 'User-Agent' => $_SERVER['HTTP_USER_AGENT'], 'Accept-Encoding' => 'application/json' ], 'timeout' => 5, 'connect_timeout' => 5 ] ]); } } // End of BaseApiModel.php