I need to associate my twitter application with my twitter account. In particular I would that when I click log out on my twitter account(https://twitter.com/) I log ou from my app twitter.In the code that I show below the login works but when I log out from my twitter account it doesn't log out from the app so the session is not close. The code is:
if (!isset($_SESSION["request_token"])) {
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
$request_token = $connection->oauth("oauth/request_token", array("oauth_callback" => OAUTH_CALLBACK));
if($request_token){
(NEEDED IN THE NEXT SCRIPT)
$oauth_token=$request_token['oauth_token'];
$token_secret=$request_token['oauth_token_secret'];
$_SESSION['request_token']=$oauth_token;
$_SESSION['request_token_secret']=$token_secret;
;
$url = $connection->url("oauth/authorize", array("oauth_token" => $oauth_token));
header('Location: ' . $url);
}
}else{
$connection = new TwitterOAuth(TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);
$oauth_verifier = $_SESSION ['oauth_verifier'];
$token_secret = $_SESSION ['request_token_secret'];
$oauth_token = $_SESSION ['request_token'];
$trovato = false;
$connection = new TwitterOAuth (CONSUMER_KEY, CONSUMER_SECRET, $oauth_token, $token_secret );
$access_token = $connection->oauth("oauth/access_token",
$connection = new TwitterOAuth ( CONSUMER_KEY, CONSUMER_SECRET, $access_token ['oauth_token'], $access_token ['oauth_token_secret'] );
$content = $connection->get ( "account/verify_credentials" );
if(!empty($content->id)){
$_SESSION['screen_name']=$content->screen_name;
header('Location: ....);
}
The library is : https://github.com/abraham/twitteroauth Who are the parameters that I can use to check my log in?Anyone can help me?