Rather than mess about trying to delete sessions and stuff, why not store the time of the last time the user did something in the database?
On each page you'd call a sql query that updated a field in the user record that stores when they hit the page:
update user set last_hit = NOW();
Then, when you generate the list of users active you just need to pull out all the users whose last_hit is within the last 15 minutes:
select * from user where last_hit < DATE_SUB(NOW(), INTERVAL 15 MINUTE);