Php session logout and login issues. In php, if the session is used to determine whether the user logs on to the server and exits, it can be like this: session_start (); session_destroy (); the session indicates that it has ended. The next statement should be written in php. if the session is used to determine whether the user logs in or out, this can be done:
Session_start ();
Session_destroy ();
The session is ended. In the next sentence, JavaScript should be written to redirect the page.
Script alert ("logged out! "); Location. href =" login. php "; script
If it is a framework page, do not use location directly. Because this will jump in a small frame page, the intention must be that the entire framework should jump over. Therefore, "parent." must be added before location .".
The entire process is as follows (for the Framework page only ):
The code is as follows:
Session_start ();
Session_destroy ();
// To redirect the entire framework page to the login page
Echo "script" alert ('logged out '); parent. location. href = 'login. php'; script ";
?>
Sessions session_start (); session_destroy (); the session is over. The next sentence should be written...