getItem(Session::SESSION_KEY . '.' . CacheHelper::sanitizeUsername($credentials->getLogin())) ->get() ->getCookieByName('sessionId'); // Generate CookieJar from instagram cookie 'sessionid' $cookieJar = new CookieJar(false, [$sessionId]); /** 2. Insert cookies manually $sessionId = new SetCookie([ "Name" => "sessionid", "Value" => "YOUR_INSTAGRAM_SESSIONID", "Domain" => ".instagram.com", "Path" => "/", "Expires" => "YOUR_INSTAGRAM_SESSIONID_EXPIRES", "Max-Age" => "31536000", "Secure" => true, "Discard" => false, "HttpOnly" => true, ]); // Generate CookieJar from instagram cookie 'sessionid' $cookieJar = new CookieJar(false, [$sessionId]); */ try { $api = new Api(); // Optionals for set user agent and language $api->setUserAgent('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.57 Safari/537.36'); $api->setLanguage('id-ID'); $api->loginWithCookies($cookieJar); $profile = $api->getProfile('robertdowneyjr'); dd($profile); } catch (InstagramAuthException $e) { print_r($e->getMessage()); } catch (InstagramException $e) { print_r($e->getMessage()); }