php - Destroy all sessions but one -
I have a problem similar to this problem: (Hull)
I'm trying to delete Unset all sessions except one session called 'session' with a user logout. I do not want to unset each session manually because I have many sessions
This is my logout. Php is
& lt ;? Php session_start (); Forex currency ($ _ session $ key = & gt; $ value) {if ($ key! == "id") {set ($ _ session [$ key]); }} Header ("location: login.php"); Go out; ? & Gt; This code currently deletes all sessions and does not have a session named session.
What am I missing?
Instead of deleting all others you have to $ _ session ['id'] Re-Assign.
A little trick :)
Comments
Post a Comment