I made a wrapper to manage my user sessions in Php, and I want to add a function that destroys the sessions, here is how I did:
<?php
class SessionManager
{
.
.
.
static function destroy()
{
session_destroy();
}
}
?>
When logging out the user I need to destroy its session, so I call the destroy()
function like this in the logout.php:
<?php
include('SessionManager.php');
$mySess = new SessionManager();
$session = $mySess -> sessionStart('InstallationName'); // create/start a new session or start the existent session
$mySess -> destroy();
echo $_SESSION['cook'];
?>
But the problem is that when executing this code, it still displays the token value of $_SESSION['cook']
(something like t2utt3uejvamu1kq623vl29pd2
), which means that the session is not distroyed.
p.s: I made a post before with the same piece of code, but I have a new problem now with the same code.