bug978990 - remove window event listener during login, logout