Its impossible to delete them as soon as they have gone. PHP cannot tell when a user has left, as it doesnt work on the client side
Javascript cant do it either.
I guess your going to have to just accept that... Unless you create a pop under when the user leaves. Although this isnt a great idea if your really deperate its the only alternative i can think of.