if (isset($_POST['clear'])) {
session_unset($_SESSION['dataRow']);
session_unset($_SESSION['dataColumn']);
session_destroy();
echo ' Data has been deleted. ';
}
答案 0 :(得分:3)
Unset将销毁特定的会话变量,而session_destroy()将销毁该用户的所有会话数据。
请记住以下几点,这取决于您的应用程序如何使用它:
unset($_SESSION['name']); // will delete just the name data
session_destroy(); // will delete ALL data associated with that user.