In this specific case, you have to revert and set the properties in the object inspector. Then it will work automatically, because the properties would be already set when the application reloads.
If you want to keep the properties set from code, then you can simply call Login method again, it will do the automation and call the event if user is logged in.