i am creating a website with login and logout and registration but an error appear every time i want to logout how to fix it i think the eroor is in the session this error make me crazy i did a lot of search about fixing the problem but i did not get any solution that help me.
logout.php
<?php
session_start();
session_destroy();
if(isset($_COOKIE['id_cookie'])){
setcookie("id_cookie", "", time()-50000,"/");
setcookie("pass_cookie", "", time()-50000,"/");
}
if(isset($_SESSION['username'])){
echo("we could not log out try again!");
exit();
}else{
header("Location: home.php");
}
?>