logout on window unload