Yes I just looked at the phpinfo() and restarted everything and cleared the browser cookies. Still, www.mydomain.com does not use the same sessions as mydomain.com
Other than that, I was wondering if you could please guide me as how to code the sessions, I don't expect code, but at least maybe a series of tasks that I should do.
Right now this is what my code looks like:
index page:
...
if (isset($_SESSION['valid_user'])){
//$username = $_SESSION['valid_user'];
header("Location: member.php");
} else {
// unsuccessful login do NOTHING!
}
member page:
...
if ($username && $passwd)
// they have just tried logging in
{
$loggedin = login($username, $passwd);
if (!$loggedin)
{
// unsuccessful login
echo ('Problem: ');
echo 'You could not be logged in. You must be logged in to view this page. ';
echo ('<a href="index.php">Log in</a>');
echo "</BODY></HTML>";
exit;
} else {
// if they are in the database register the user id
$_SESSION['valid_user'] = $username;
}
}
if (isset($_SESSION['valid_user'])){
$username = $_SESSION['valid_user'];
} else {
// unsuccessful login
echo ('Problem: ');
echo 'You could not be logged in. You must be logged in to view this page. ';
echo ('<a href="index.php">Log in</a>');
echo "</BODY></HTML>";
exit;
}
// Check what the user's function is (i.e. member, admin, ...)
if (check_usrfunction($username) == "admin"){
echo "<a href='member_admin.php'>admin page</a>";
}