Fixed login/logout, creating added security along the way.