session_unset()
Release all $_SESSION variables currently created in memory, but do not delete the session file and do not release the corresponding session
id
session_destroy()
Delete the session file corresponding to the current user and release the session
id, in memory The contents of the $_SESSION variable are still retained. Therefore, to release all resources of the user's session, the following code needs to be executed sequentially:
Copy the code The code is as follows:
$_SESSION['user'] = 'lowell';
session_unset();
session_destroy();
?>