<?php include ("database.php"); unset($_SESSION['USER']); session_destroy(); if(isset($_SESSION['USER'])) { echo "loggedin"; } else { echo "logout"; }