<?php
require_once('comment/startsession.php');
$title = "log Out";
require_once('comment/header.php');
if (isset($_SESSION['user_id'])) {
//清除session值
$_SESSION = array();
//删除cookie
if (isset($_COOKIE['user_id']) || isset($_COOKIE['username'])) {
setcookie('user_id','',time() -3600);
setcookie('username','',time() -3600);
}
session_destroy();
echo '<p class="pass">log out seccussful!<p>';
}
echo '<p><a href="mismatch_login.php">Login</a>❤</p><br>';
echo '<p><a href="mismatch_index.php">home</a>❤</p>';
require_once('comment/footer.php');
?>