Hi Everyone, I am trying to create a twitter login app, I have the app created and I can log into my app, But what I would like to do is create a number of session virables so I can use the information in my app.
When a user authenticates with thier twitter account, They are returned to the app,
But when I redirect them to a new page in my website, the session data is not carrying over to the new page?
I have included the session.php in the new page.
Here is where the session data is being set
$id = $_SESSION['id'] = $result['id'];
$username = $_SESSION['username'] = $result['username'];
$oauth_uid = $_SESSION['oauth_uid'] = $result['oauth_uid'];
$oauth_provider = $_SESSION['oauth_provider'] = $result['oauth_provider'];
$oauth_token = $_SESSION['oauth_token'] = $result['oauth_token'];
$oauth_secret = $_SESSION['oauth_secret'] = $result['oauth_secret'];
and here is my sessions file.
session_start();
/////////// SESSION ID ///////////////////////////
if (isset($_SESSION['id'])) {
$id = $_SESSION['id'] = $result['id'];
} else {
header("location: login.php");
exit();
}
/////////// SESSION USERNAME ///////////////////////////
if (isset($_SESSION['username'])) {
$username = $_SESSION['username'] = $result['username'];
} else {
header("location: login.php");
exit();
}
/////////// SESSION OAUTH_UID ///////////////////////////
if (isset($_SESSION['oauth_id'])) {
$oauth_id = $_SESSION['oauth_uid'] = $result['oauth_uid'];
} else {
header("location: login.php");
exit();
}
/////////// SESSION OAUTH_PROVIDER ///////////////////////////
if (isset($_SESSION['oauth_proider'])) {
$oauth_provider = $_SESSION['oauth_provider'] = $result['oauth_provider'];
} else {
header("location: login.php");
exit();
}
/////////// SESSION OAUTH_TOKEN ///////////////////////////
if (isset($_SESSION['oauth_token'])) {
$oauth_token = $_SESSION['oauth_token'] = $result['oauth_token'];
} else {
header("location: login.php");
exit();
}
/////////// SESSION OAUTH_SECRET ///////////////////////////
if (isset($_SESSION['oauth_secret'])) {
$oauth_secret = $_SESSION['oauth_secret'] = $result['oauth_secret'];
} else {
header("location: login.php");
exit();
}
Where is it that I am going wrong please.