I have a session like this $_SESSION['login']
and when it is equal with 1
, it means the use is logged into my website:
if ( $_SESSION['login'] == 1 ) {
// You are logged
} else {
// login/register
}
Also I have another session which contains user's id. Something like this:
echo $_SESSION["Id"];
/* It is containing the user's id (an integer number).
Something like: 234124
*/
Now I want to unset $_SESSION['login']
for the user who has a specific id. For example I want to unset($_SESSION['login'])
for $_SESSION["Id"] = 234124
. How can I do that?
Edit: All I'm trying to do: When an user changes his password, I remove all his cookies from cookies
table to sign him out from all his other devices. Also I want to remove his session.