Added code to detect duplicate logons and terminate existing session.  This is useful in case the user gets disconnected and tries to reconnect.