Not getting oauth_token_secret


#1

Well I’m using Abraham’s PHP library and I seem to be running into a problem. I do exactly how it says to go in his documentation but it just wont work. It worked one day and then not the next. Here is a snippet of my code:

$twitteroauth = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);
$access_token = $twitteroauth->getAccessToken($_GET['oauth_verifier']);
$_SESSION['access_token'] = $access_token;
$user_info = $twitteroauth->get('account/verify_credentials');
print_r($user_info);

Although I just keep getting an error when I return from the oauth/authorize page. My URL does not have the ‘oauth_token_secret’ and I just can’t figure out where it’s gone.
Here is the error:
stdClass Object ( [errors] => Array ( [0] => stdClass Object ( [message] => Your credentials do not allow access to this resource [code] => 220 ) ) )

Can anyone help ?


#2

It’s okay I figured it out turns out that the oauth_token_secret was stored in my session however when i redirected from oauth/authorize my session was being destroyed. All fixed now, simply forgot to put the s after http. stupid things that hold you back.