If you are storing any information in your settings (like username, password, ID#) it's could to unset those as well! Adding on to your code here:
session_start();
unset($_SESSION['username']);
unset($_SESSION['email']);
unset($_SESSION['password']);
$_SESSION = array();
session_destroy();
header('Refresh: 3; index.php');
exit();
echo "Logged out. Redirecting in 3 seconds";