PHP Logout And Session Issues -


hers logout script on logout.php:

unset($_session['user']['id']);         session_unset();         session_destroy();         echo '<script type="text/javascript">window.location="login.php"</script>'; 

my problem after logout when click on browser button got redirect index.php page. index.php shown while , after redirected login.php. don't understand why redirect index.php page. don't want show page / content user second after gets logged out.

no need of unset($_session['user']['id']); , session_unset();. session_destroy() all. try -

session_destroy(); header('location:logout.php'); exit; 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -