Logout function using PHP PDO Object oriented [closed]

2

I'm having a big problem with the panning function, I made a public function Logout ()

Login.class.php file:

public function Logout(){
    if($this->isLogged()) {
        unset($_SESSION[$this->prefix.['email']]);
        unset($_SESSION[$this->prefix.['password']]);
        session_destroy();

        return true;
    } else {
        return false;
    }
}

And in my

panel.php file it looks like this:

session_start();
$Logins = new Logins();
if (!$Logins->isLogged()) {
    header("Location: ?pag=login");
} else {}
if(isset($_GET['action']) == 'logout') {
    if($Logins->Logout()) {
        header("Location: ?pag=login");
    }
}

Now that I'm having problems, I'm exactly 8 hours stuck in it, when I click Logout it goes back to home.php but session does not destroy, nothing happens at all. What am I doing wrong?

    
asked by anonymous 16.05.2015 / 09:18

0 answers