loadCookies() public method

Load cookies for specified username
public loadCookies ( string $username = '' ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient
$username string
return seregazhuk\PinterestBot\Api\Contracts\HttpClient
Example #1
0
 /**
  * Load cookies for this username and check if it was logged in.
  * @param string $username
  * @return bool
  */
 public function autoLogin($username)
 {
     $this->httpClient->loadCookies($username);
     if (!$this->httpClient->cookie('_auth')) {
         return false;
     }
     $this->login();
     return true;
 }