In php, if you use session to determine whether the user is logged in or logged out, you can do this:
session_start();
session_destroy();
The session is now over. The next sentence should be written in js to make the page jump.
<script>alert("Logged out!");location.href="login.php";</script>
If it is a frame page, don’t use location directly. Because this will jump within a small frame page, the original intention must be to jump to the entire frame. Therefore, "parent." must be added before location.
The whole process is as follows (only for frame pages):