apply login/logout