I have decided to use a php session + cookie based site from previously just using cookies. So here are my main parts.
Login set cookie + Session
$user = mysql_fetch_array(mysql_query("SELECT * FROM user WHERE username='".addslashes($name)."'"));
setcookie("cookieid", $user[id], time()+86400,"/betaf","nodqforums.com");
$_SESSION['uid'] = $user[id];
Logout Remove Session + Cookie
setcookie("cookieid", 0, time()-86401,"/betaf","nodqforums.com");
unset($_COOKIE["cookieid"]);
$_SESSION = array();
session_destroy();
So far so good. On that page a person is logged out. Now for my index page basically if a user has a cookie stored I want them to be automatically recognized as login so their settings are saved and so forth. Problem is after logging out that session is destroyed, but if a user types in index.php, the cookie suddenly is still alive. Thus user won't be logged out.
if ($_COOKIE['cookieid'] >= 1) {
$_SESSION['uid'] = $_COOKIE['cookieid'];
}
Any ideas on how to solve?