i am just trying to destroy my session with session_destroy but its not getting destroy this is my code of logout.php
<?php
session_destroy();
//print_r($_SESSION);exit;
?>
<script type="text/javascript">
location.href=root_path+"index/";
</script>
i am getting a waring
Warning: session_destroy(): Session object destruction failed in F:\xampp\htdocs\synthesis\module\login\logout.php on line 3
if i remove third line from comment and click again on logout its showing me array of $_SESSION with all data and if i do comment it again without refreshing browser and then refresh the browser then session is getting destroy i am calling this page from my index page and on index page i have written session_start