Home >Backend Development >PHP Tutorial >Regarding the temporary processing method that the session cannot be automatically removed (reprinted) I have never used the SESSI_PHP tutorial
Regarding the temporary solution to the problem that the session cannot be automatically removed
The problem is:
"PHP's session will always save the information entered when the user enters for the first time, even if you return to the login screen and log in again, it will not change! This I found the problem in php4.02, but it still failed in the latest php 4.03pl1 test! Only when the user closes the IE browser and reopens the IE window can the session content be eliminated
Temporary solution:
When the form After submission, do not register the variable submitted by the form. After assigning the variable to another variable $X, register $X. In this way, you can change it by returning to the login screen and logging in again. To be more safe, you can change it on the login page. Add a sentence at the top of the page to delete the variable $X.
For example: This is the login part of my chat room
1 The login page sends $name, $pass
2 This can be done in login.php
$save_name = $name;
$save_pass = $pass;
session_start();
session_register("name");
session_register("pass");
$name=$save_name;
$pass=$save_pass;
......
?>