It took me a while to figure out how to destroy a particular session in php. Note I'm not sure if solution provided below is perfect but it seems work for me. Please feel free to post any easier way to destroy a particular session. Because it's quite useful for functionality of force an user offline.
1. If you're using db or memcached to manage session, you can always delete that session entry directly from db or memcached.
2. Using generic php session methods to delete a particular session(by session id).
<?php
$session_id_to_destroy = 'nill2if998vhplq9f3pj08vjb1';
if (session_id()) {
session_commit();
}
session_start();
$current_session_id = session_id();
session_commit();
session_id($session_id_to_destroy);
session_start();
session_destroy();
session_commit();
session_id($current_session_id);
session_start();
session_commit();
?>