I have a PHP login / logout system. The code for the logout is as follows:
if($_POST['submit']=='logOut')
{
setcookie('userName','', time()-60*60*24*100);
setcookie('login','', time()-60*60*24*100);
header("Location: index.php");
exit;
}
Users are being checked for login status via the following:
<?php
if(!$_COOKIE['login']):
// If you are not logged in
?>
As far as I can tell, this should log the user out, but it doesn’t seem to do so. The site can be viewed at novabvuild.comlu.com, and default login information can be used (admin, admin). This way you folks can see the issue. Login seems to work fine, but the logout doesn’t run properly.
Thanks in advance!
Try adding a path:
You might also get away with:
unset($_COOKIE['cookieName']);