Figuring out if the user is logged in or not!?
I'm sure this is quite a simple question... but I can't seem to get my head round the issue...
I simply want to be a able to display 'Login' if the user is NOT logged in and 'Log Out' if the user is logged in. This is the code that I've created...
<?php if (isset($_SESSION['User_ID'])) {
echo '<a href="/Users_LogOut.php">Log Out</a>';
} else {
echo '<a href="/login.php">Login</a>';
} ?>
Whether I'm logged in or out, I'm always seeing 'Login'. Any ideas why?
Kind Regards,
Dan