Sometimes when a user closes a XenApp published application, the Citrix user session stays in active state. This is caused by Windows system processes or by the application sub processes that are not closing properly. By default Citrix XenApp has a hard coded list of processes that are checked for and terminated when the user logs off.
With the following registry tweak you can add processes to this list;
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Citrix\wfshell\TWI
Value Name: Logof
Type: REG_S
String: app1.exe,app2.exe
Executables must be separated with a comma.
One of the most common executable that has to be added is sftdcc.exe. It must be added at the time that the Microsoft AppV RDS Client is installed on the Citrix XenApp server.
Also make sure that there are no spaces between the commas. I found that if you put a space in there then it ignores the rest of the exes that should be excluded.