Fixed issue #9381: Bug when showing message of invalid token

This patch apply to 2.05 and 2.06 branches