Instagram\Instagram::initFromSavedSession PHP Method

initFromSavedSession() public method

Initialize the Instagram instance from a previously saved session
See also: Instagram::saveSession()
public initFromSavedSession ( $session )
$session string Instagram session JSON
    public function initFromSavedSession($session)
    {
        $session = json_decode($session, true);
        if (!$session) {
            throw new InstagramException("Failed to deserialize Saved Session!");
        }
        $this->setLoggedInUser(new User($session["loggedInUser"]));
        $this->setCookies($session["cookies"]);
        $this->setCsrfToken($session["csrfToken"]);
        $this->setRankToken($session["rankToken"]);
        $this->setPhoneId($session["phoneId"]);
        $this->setDeviceId($session["deviceId"]);
        $this->setGuid($session["guid"]);
        $this->setUuid($session["uuid"]);
        $this->setGoogleAdId($session["googleAdId"]);
    }