This document references XRDP Tip:how to reconnect to the existing session while using the XRDP package from Ubuntu Repository
The first connection to remote Desktop is the port at which the connection is observed:
Then run:
sudo vim/etc/xrdp/xrdp.ini
Insert under [XRDP1]:
[XRDP8]
Name=reconnect
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=5910
Where 5910 is the port number observed just now, the schematic is as follows:
When you close the remote window and then log back in, select the Reconnect option and log in again to restore the last remote session, as shown in the following diagram:
When you have multiple accounts, you can add [XRDP9],[XRDP10] ..., but the port number is different when you log on to different computers, so it's best to set the port number that is displayed when you log on to the most commonly used computer