2 回答

TA贡献1876条经验 获得超6个赞
试试这个!我没有看到您将名称传递给会话的任何地方。
if(isset($_GET['logout'])){
// Initialize the session
session_start();
// Unset all of the session variables
session_unset();
$_SESSION = array();
// Destroy the session.
session_destroy();
unset($_SESSION['user']);
// Redirect to login page
header('Location:http://leopard.med.agfa.be/leopard/website/logIn.php');
exit();
}
注意:我使用了这两个unset()和destroy()功能,你可以使用一个。

TA贡献1788条经验 获得超4个赞
将注销脚本更改为:
<?php
if(isset($_GET['logout'])){
// null the _SESSION
$_SESSION = null;
// unset $_SESSION variable for the run-time
session_unset();
// destroy session data in storage
session_destroy();
// last, redirect
header('Location:http://leopard.med.agfa.be/leopard/website/logIn.php');
}
?>
- 2 回答
- 0 关注
- 116 浏览
添加回答
举报