I have this forum and I want to keep users logged in if they check the check box that says logged it. So i added this php code to set the cookie :
$year = time() + 31536000;
if($_POST['remember']) {
setcookie('email', $_SESSION['email'], $year);
}
elseif(!$_POST['remember']) {
if(isset($_COOKIE['remember_me'])) {
$past = time() - 100;
setcookie(email, gone, $past);
}
}
But, how do i keep them signed in into my forum using this cookie, I have been stuck on this for some time now.