Dialog Box blocking connection

If I end a remote session using the web client, a dialog box will appear on the remote computer saying the session has ended etc, and "Ok" must be clicked to close the box (which i can't do as the session is ended). If I try to re-connect to the computer, the presence of this box seems to prevent it. The "connecting" screen says it's ready to connect, but nothing happens. If I ask a colleague to go to the computer and close the dialog box, then I can connect remotely again.

How do I prevent this?

Thanks