I have used jmathai-twitter-async for creating a twitter app on my website using PHP. everything is working fine except that it always login through only one account and that account is the one through which i have created the twitter app on dev.twitter. can anyone tell me what can be the reason behind this? Is it the exception in api or am i missing something? thanks in advance. i thought in the begining that i have hardcoded it… but i checked whole of my code but i found nothing. here’s is my code for login-twitter.php
<?php
session_start();
require_once('twitterLib/EpiCurl.php');
require_once('twitterLib/EpiOAuth.php');
require_once('twitterLib/EpiTwitter.php');
require_once('twitterLib/secret.php');
require_once('config/functions.php');
$twitterObj = new EpiTwitter($consumer_key, $consumer_secret, $token, $secret);
$twitterObjUnAuth = new EpiTwitter($consumer_key, $consumer_secret);
$oauth_token = $_GET['oauth_token'];
if($oauth_token == '')
{
$url = $twitterObjUnAuth->getAuthenticateUrl();
header('Location:'.$url);
}
else{
$token = $twitterObj->getAccessToken();
$twitterObj->setToken($twitterObj->token, $twitterObj->tokenSecret);
$_SESSION['ot'] = $twitterObj->token;
$_SESSION['ots'] = $twitterObj->tokenSecret;
$twitterInfo = $twitterObj->get('/account/verify_credentials.json');
$twitterInfo->response;
$username = $twitterInfo->screen_name;
$profilepic = $twitterInfo->profile_image_url;
$uid = $twitterInfo->id;
$ip_address = $_SERVER['REMOTE_ADDR'];
$_SESSION['oauth_id'] = $uid;
$_SESSION['username'] = $username;
$_SESSION['oauth_provider'] = "twitter";
$user = new User();
$userdata = $user->checkUser($uid, 'twitter', $username,'',$twitterObj->token,$twitterObj->tokenSecret,$profilepic,$ip_address);
if(!empty($userdata)){
$_SESSION['id'] = $userdata['id'];
header('Location:index.php?id='.$_SESSION['id']);
}
else
{}
}
?>
now the problem here is that $twitterInfo->response is always giving the same response i.e. it is always login with the account through which i have created the app. why it is so?