#php - session if logout from user side admin side automatically logged out -




if logged in @ user side , admin side @ same time, when click on logout button on user side logged out admin side while both sides have it's on login , logout files.

code of user side logout file

<?php     session_start();     session_destroy();     header('location:index.php'); ?> 

code of admin side logout file

<?php     session_start();     session_destroy();     header('location:login.php'); ?> 

parent folder "reservation system" contain user side file , child folder "admin" contain admin side files.

don't use session_destroy(); here. session_destroy() deletes session data associated current session. check link: http://php.net/manual/en/function.session-destroy.php

use

unset($_session["user_id"]); unset($_session["username"]); 




wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -