Add event listener to session instead of global window object