As far as my knowledge, when you close window, sessions get destroyed
and no need to write sign out code, If you are using cookies then you
can execute sign out code calling window close event through ajax or
opening another sign out page.
If this is not sufficient please mail me in details.
Thanks
Zeeshan