minor cleanup
logout and relogin when the username is different. Place principal on message header for post processing