0

我现在正在做一个项目,如果我以用户身份登录,我将无法访问我自己的个人资料页面 - 我在每个页面的顶部设置了 thisi 规则:

 if(!isset($_SESSION['loggedin']))
header("location:http://localhost/ci/web-project-jb.php/start");// If an unregistered user tries to manually navigate to any of my webpages they will be brought to 'start' page. 

起始页有

 <$_SESSION['username'] = null;?> 

只是为了确保会话已被销毁

我在我的注销功能中设置了它将破坏会话:

function logout()
{
$this->session->sess_destroy();
redirect ('start');
}

我有一个 session_start(); 在我登录后在我的主页上(在我的登录页面上也有)但是由于我已经将上面的 if 语句放在我不能再以注册用户身份登录 - 为什么会发生这种情况?我什至在登录页面调用了 session_start。再次感谢你的帮助

4

0 回答 0