Instagram\Instagram::setCookies PHP Method

setCookies() public method

public setCookies ( array $cookies )
$cookies array
    public function setCookies($cookies)
    {
        $this->cookies = $cookies;
        if (array_key_exists("csrftoken", $cookies)) {
            $this->setCsrfToken($cookies["csrftoken"]);
        }
    }

Usage Example

 /**
  *
  * Execute the Request
  *
  * @return object Response Data
  * @throws InstagramException
  */
 public function execute()
 {
     $response = parent::execute();
     $this->response = $response;
     if ($this->interceptResponse($response)) {
         return null;
     }
     if ($this->throwExceptionIfResponseNotOk() && !$response->isOK() && !$response->isJson()) {
         return $response->getCode();
     }
     $this->instagram->setCookies(array_merge($this->instagram->getCookies(), $response->getCookies()));
     if ($this->parseResponse()) {
         return $this->mapper->map($response->getData(), $this->getResponseObject());
     }
     return $response->getData();
 }