There seems to be some trouble with the following chunk of code.
WHEN TranPath_1 is "system_one"
and TranPath_2 is "system_logout">
<h2>System Logout Successful</h2>
We are trying to use this chunk of code to kill an arbitrary connection that we pass to screensurfer on the url (sessionKey). Occasionally our reps machines go down, and they don't properly exit our application. As a result, a connection gets left open in screensurfer. So as a default precaution, we try to logout (we store the unique screensurfer sessionkey in the database) whenever logging in. Unfortunately, this appears to be causing looooong timeouts.
By passing the variable SessionKey in your request, Screensurfer will automatically try to connect you to the session specified in the key--but if the key is no longer valid for any reason (such as the session being timed-out, or Screensurfer being rebooted), it will not cause an error. This is because it was decided that the implicit connection attempt should not "bomb" on an invalid sessionkey.
I suspect that your long timeouts are from this situation, and are related to not having a valid sessionkey.
Since all you want is to assure that the old session isn't still open, it is okay to just exit if the old session is no longer valid. To do this, you perform a:
The Task.SessionActive variable is 1 or "true" if you are connected to a session, otherwise it is 0.