session destroy not working

Solutions on MaxInterview for session destroy not working by the best coders in the world

showing results for - "session destroy not working"
Silvana
03 Mar 2016
1//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.
2
3//You can manually clear $_SESSION if you so desire ($_SESSION = [];).
4 <?php
5 $_SESSION = [];
6 session_unset();
7 session_destroy();
8?>