Code: Select all
setcookie('SKP_USER',$_POST['user'],time()+60*60*24*7); // 7 days
setcookie('SKP_PASS',md5($_POST['pass']),time()+60*60*24*7);Code: Select all
function is_logged() {
if (isset($_COOKIE['SKP_USER']) && isset($_COOKIE['SKP_PASS'])) {
$user = $_COOKIE['SKP_USER'];
$pass = $_COOKIE['SKP_PASS'];
return true;
}
return false;
} // truncatedYes, double-checked that the cookies are indeed set.
Edit: Another question... unset($_COOKIE['name']) refuses to work. How do I unset a cookie?? O.o