Lets say I'm writing account and user roles system. I have:
session_start();
$_SESSION['username']; //if its set user is logged
My site has admin panel with list of users. I want to make "delete user" button. This button should delete server cookie of chosen user to immediately delete his account (if troublesome user was logged in that time he should lost all access to website).
I can't use session_destroy() because it destroying current session (mine) and not session of my not longer wanted user.
How to delete session of not current user?
// edit Please read carefully question. I don't want to clear my session with unset($_SESSION['my_var']). I want to unset someone else session.
Bill is admin of site. Sally is user. Bill wants to immediately delete Sally account, he removed her from database but Sally is still able to traverse site because her server cookie is still valid (she never executed any code with unset($_SESSION['Sally])).