I believe that the Core.InitializeSession() method (this is the Mendix 5 method, but it should be true for Core.Login() as well) commits the User object, to set the LastLogin and FailedLogin attributes.
You should be aware that the functionality differs for local deployments and cloud deployments: an AfterCommit event handler on Account will not trigger on login on a local deployment, but it will trigger in the cloud. Did you deploy your test project in the cloud?