0

I am new to PHP world. Currently, it's version is 5.

I'm trying to prepare a logout script.

I tried-

session_start();
unset($_SESSION["abc"]);
session_destroy();

But still the session vars are alive. I also tried from php.net

session_start();
$_SESSION = array();
if (ini_get("session.use_cookies")) {
    $params = session_get_cookie_params();
    setcookie(session_name(), '', time() - 42000,
        $params["path"], $params["domain"],
        $params["secure"], $params["httponly"]
    );
}
session_destroy();

Unfortunately, it's not working too.

Any help?

NOTE I already tried that and I mentioned that code in my question. So it's not a duplicate question.

s.k.paul
  • 7,099
  • 28
  • 93
  • 168

0 Answers0