Hello everyone.
I'm currently trying to build a session system for a website I'm putting up. The session is supposed to handle username and login from the beginning of the site, which would then activate several features for members. Trouble is, whenever the user logs in to the website, the session variable for the user resets and no longer holds the new value inputted by the user.
Here's the code I used for index:
<SCRIPT language="php">
session_name("TAOnline");
session_start();
header("Cache-control:private");
if (!session_is_registered("user") || $user==NULL)
{
session_register("user");
$user="Guest";
}
</SCRIPT>
Then here's the snippet that calls upon the database to verify:
elseif ($query_total=="1")
{
echo $user;
echo $password;
session_unregister(user);
session_unregister(password);
echo $user = $userRegisterLogin;
$password = $userRegisterPassword;
$id = mysql_result($registerUserQuery,0,"member_index");
session_register(user);
session_register(password);
session_register(id);
print("<META http-equiv=\"Refresh\" CONTENT=\"0;URL=../index.php\">");
}
Any thoughts on this? Thanks in advance...