Reputation: 179
I know there is heaps of this on the internet and i have tried things like use cookies (didnt work) check for blank anchors like and i have none of them. Microsoft is terrible i think we can all agree!
On safari, chrome and firefox etc (the good browsers) the code works fine and logs the user in. I am assuming the problem is resting with the session or cookie data because if you type in a wrong username/password on the website it comes up with an error saying its invalid (on internet ex).
The code where i am setting the session and cookies is this:
session_start();
$_SESSION['user_id']= $id;
$_SESSION['user_name'] = $full_name;
$_SESSION['user_level'] = $user_level;
$_SESSION['HTTP_USER_AGENT'] = md5($_SERVER['HTTP_USER_AGENT']);
So this should work fine should it not? Thank you for taking time to read this.
Quick edit: I also have a facebook login button and this section of code is if the account is linked (it still involves $_SESSION):
while ($row = mysql_fetch_array($SrcUser))
{
$id = $row["id"];
$user_level = $row["user_level"];
}
session_start();
$_SESSION['user_name'] = $full_name;
$_SESSION['user_level'] = $user_level;
$_SESSION['user_id']= $id;
mysql_query("update `users`
set `ckey`= '', `ctime`= '', `online`='0'
where `id`='$_SESSION[user_id]'") or die(mysql_error());
// Javascript redirect.. its kinda cheating to be honest as if i dont use it i will have awkwardness with header errors
?>
<script type="text/javascript">
window.location = "myaccount.php"
</script>
Upvotes: 1
Views: 128