window.close() does not help you?
or
you don't want it in html?

deleting session on a tab?
that should happen