I can't like, comment or follow except searching hashtags! and if I check the login it's not even logged in. I missed something?
include("vendor/autoload.php");
use \Instagram\Instagram;
$callback = array();
try{
$instagram = new \Instagram\Instagram();
$method = json_decode($_POST['method_obj']);
$session = $_POST['session'];
$instagram->initFromSavedSession($session);
$response = $instagram->ConfirmVerificationCode($_POST['url'], $_POST['code']);
if($response->status == "ok"){
$user = json_decode($instagram->saveSession());
$userId = $user->cookies->ds_user_id;
$user->loggedInUser['pk'] = $userId; //<---------- Saved session
//Code for callback on android app
$code = "checkpoint_success";
array_push($callback, array("code"=>$code,"session"=>$user));
echo json_encode($callback);
exit();
}
}catch(\Exception $e){
$message = "Wrong code";
$code = "checkpoint_failed";
array_push($callback, array("code"=>$code,"message"=>$message));
echo json_encode($callback);
exit();
}