Initial event handling and login/logout events