Split into login and logout scripts.