Occasionally a user might experience disconnection of an idle session. One reason this can occur is the configuration of the power settings on the client computer. One way to minimize the chances of disconnection of idle sessions is to set the PCs power settings to stop the computer from going into sleep or hibernate modes.

Deactivating the power management of the network card on the server and client can also be useful.

It is also possible to set the server to 'keep alive' all remote session using local policies.

To do so, click start, type in "gpedit.msc"

Locate the following local group policy :

Local Computer Policy\Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Session Time Limit

Here you will find 4 strategies that you may find useful. 

1- Set time for disconnected sessions - This strategy is used for logging off a disconnected session after a certain time. This can also be set in the Admin tool.

2- Set time limit for active but idle Remote Desktop Services sessions -  this strategy is used to force a disconnection of active but idle session, this can be useful for freeing a session for another active user.

3- Set time limit for active Remote Desktop Services session - This strategy is used to force disconnection of active session, for example a user can remotely connect for a limited duration of 30mn then will be disconnected. This strategy is rarely used.

4- Terminate session when time limits are reached - This strategy is useful for logging off disconnected session and can be used with a mix of the above strategies.