getAccessToken($_REQUEST['oauth_verifier']); /* Save the access tokens. Normally these would be saved in a database for future use. */ $_SESSION['access_token'] = $access_token; /* Remove no longer needed request tokens */ unset($_SESSION['oauth_token']); unset($_SESSION['oauth_token_secret']); /* If HTTP response is 200 continue otherwise send to connect page to retry */ if (200 == $connection->http_code) { /* The user has been verified and the access tokens can be saved for future use */ $_SESSION['status'] = 'verified'; header('Location: ./index.php'); } else { /* Save HTTP status for error dialog on connnect page.*/ header('Location: ./clearsessions.php'); }