Capture Browser tab closing event

Capture Browser tab closing event

i want to capture browser tab closing event by mouse only.
(i have to invalidate session on browser close tab, not by auto refresh/refresh. Actually both are calling unload function and so unable to differentiate as a separate event to capture separately )