Remember last domain used to login. Closes #4116.