1. Determine whether the Session is assigned a value
if(!isset($_SESSION['username']) || $_SESSION['username']==''){
$this->redirect( 'Login/login');
}
2. Exit and clear the Session
$_SESSION=array();
if(isset($_COOKIE[session_name()])){
setcookie(session_name(),'',time()-1,'/');
}
session_destroy();
$this->redirect('Index/index');
The above introduces the PHP notes------About Session operation, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.