Thanks for the reply I found a similar solution in the index.html file using a setInterval...
Is there a way to catch the end of a RDP session in Javascript so that we can redirect...