Question : session_destroy not working
Answered by : mohamed-sami-khiari
//After using session_destroy(), the session is destroyed behind the scenes. For some reason this doesn't affect the values in $_SESSION, which was already populated for this request, but it will be empty in future requests.
//You can manually clear $_SESSION if you so desire ($_SESSION = [];). <?php $_SESSION = []; session_unset(); session_destroy();
?>
Source : | Last Update : Sat, 14 Nov 20
Question : php session destroy not working
Answered by : taylor-hawkes
//make sure you don't forget to initialize session before destroying it
session_start() ;
session_destroy();
$_SESSION = [];//and clear it for this request
Source : | Last Update : Fri, 13 Aug 21