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
Post a Comment