Search code examples
phprdpcitrix

Detect if someone is using remote desktop


Is there a way in PHP to find out if someone is connecting to my website from within a Windows Terminal Services/Citrix/RDP remote desktop environment?

My web application is experiencing some serious performance issues when (and ONLY when) someone is connecting to it using IE9 through a remote desktop connection. I know I should be looking for the cause of these problems and believe me I am. I found out however that switching to IE8 compatibilty-mode for some reason resolves the issues. So for the time being I would like to detect if someone is connecting to my website using IE9 through a remote desktop connection so I can then force IE8 compatibility-mode on them.

Any thoughts on why my web application is so much slower in a remote desktop IE9 are welcome as well. My web application is built on PHP/jQuery/jQueryUI/jqGrid/mySQL.


Solution

  • There is nothing in PHP, HTTP, HTML, the DOM, or even browser DOM extensions to know if you're running under a Terminal Services session.

    The only way is to use an ActiveX control or .NET applet to query Win32 directly. In C#/.NET you can use System.Windows.Forms.SystemInformation.TerminalServerSession, and then return that information to the server, but you can only do this after the page has loaded.

    This probably is an issue with IE9's improved Hardware Accelerated Rendering feature because Terminal Services uses the virtual rdpdd display driver. Try disabling this option in IE on the terminal server.