[PHP]Session_unset和_destroy的区别

session_unregister是注销一个session变量;
session_destroy是注销所有的session变量,并且结束session会话;
session_unset()并不注销session变量,但把所有的session变量的值清空.

那么一般在做退出的操作时可以这样做:

session_start();
session_unset();
session_destroy();
header("location:XXX.php");

你可能感兴趣的:(PHP,session,header)