issue#1: Added onLogin() and onLogout() callbacks