If it is XP Pro, the easiest way to fix this is to change the Terminal Services settings using gpedit.msc on the computer you are connecting to.
You then navigate to:
Computer Configuration>Administrative Templates>Windows Components>Terminal Services>Sessions
Set these setting:
- Sets a time limit for active Terminal Services sessions
- Sets a time limit for active but idle Terminal Services sessions
- Terminate session when time limits are reached
Then run gpupdate /force at a command prompt.
If these are on a domain, you may need to also set these in the domain group policy, or they will be overwritten every 90 minutes.
These settings handle how RDP sessions are handled.