判断session是否存在,不存在则跳转到登录页面session_start(); if ( !$_SESSION['xxx'] ) { header("Location: login.php"); exit;}
登录之后记录session退出登录之后销毁session