Apart from that it's a bad idea anyway - what if I open a link in a new tab and close the old tab or the new one - then you kill my session and I lose everything.
BEWARE!!! Just do not close the site! use LOGOUT! or else your data may be stolen (public computers)