Unreliable sessions
As the straight left
The SESSION is not reliable.
Logically, with session. Abandon, the current Session should die and disappear completely. Using session. Clear or session. RemoveAll, content should also be removed. However, this is not the case. In the process of use, sometimes the SESSION that should have disappeared (forcibly terminated with Abandon) or been replaced will come back to life, rigid and deathless, and it will jump out from time to time, frightening. But not every time. Sometimes it works, sometimes it doesn’t, until the end of time.
Where did these zombies come from? I don’t know. I tried for a long time and couldn’t find a reason.
Then I used a method to improve it.
When storing information, set information like ID and store it in two places, one is SESSION and the other is COOKIE. When reading the session, the ID is extracted from the session and COOKIE for comparison. If the ID matches, the session is valid; otherwise, it is considered as zombie.
I haven’t seen any more zombies since.