Use function declaration
Send login/logout messages