- // need to set the (shared) cookie jar
- $client = new Client(['handler' => new SafeCurlHandler(), 'defaults' => ['cookies' => $this->cookieJar]]);
- $client->getEmitter()->attach($this->authenticatorSubscriber);
+ if (!isset($config['defaults']['cookies'])) {
+ // need to set the (shared) cookie jar
+ $config['defaults']['cookies'] = $this->cookieJar;
+ }
+
+ $guzzle = new GuzzleClient($config);
+ foreach ($this->subscribers as $subscriber) {
+ $guzzle->getEmitter()->attach($subscriber);
+ }