Skip to content

Can't do any function after initializing the session #9

@leonecaramanica

Description

@leonecaramanica

After saving and initialize it for example:

$instagram->initFromSavedSession($user);

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?

Verification form code:

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();
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions