A lot of changes for login/logout.