oauthの目的でfoursquareにリダイレクトしている間、ユーザー名変数を維持しようとしています。Amazon EC2 サーバーを使用しています。関連するコードは次のとおりです。
session_start();
if (isset($_GET['username']))
{
$_SESSION['username'] = $_GET['username']
header("Location: https://foursquare.com/oauth2/authenticate?clientid=(clientidHere)&responsetype=code&redirect_uri=http://redirecturi");
}
if (isset($_GET['code']))
{
echo $_SESSION['username'];
}