4324; the session manager immediately asks the client to save its local state (only because the client has been started for the first time) the client stores the command line xyz -sid 4324 as the property RestartCommand in the session manager (this is also system-dependent: in a POSIX system, this property actually contains the argv array) the client stores its state locally; for example, it may store the name of the edited file and all other information (such as the current line) in the local file .temp-4324 when the user logs out, the session manager sends a message to all client notifying that they have to save their state the client 4324 complies again when all clients have communicated the session manager that their state is saved, the session manager shuts down the session When the client is told to save its state, it may have the possibility of having a limited interaction with the user or not (for example, to ask the user if the edited file is to be saved). Anyway, the state is saved, it tells the session manager by sending an appropriate message). When the session is started again, the following takes place: the session manager restarts the client 4324 by executing what is stored in the property RestartCommand associated with the client 4324 the application is therefore started as xyz -sid 4324; this way, the application knows its identifier the application retrieves the state information from the file .temp-4324 the application connects to the session manager specifying the identifier 4324, so that the session manager knows that this is not a new client but an old one restarting Client-managing sessions According to the XSMP protocol, a session manager is an arbitrary program (server) that runs and controls the state of other applications. As a result, a client can itself be a session manager of other clients. For example, a mail client can start a text editor for the sake of writing an email, and behave as a session manager with respect to the editor. This way, if the mail client is closed and then restarted again, it can restore the state of the text editor. Implementations The X Window System includes a default session manager called xsm. Other session managers have been developed for specific desktop environments. KDE is a default session manager of KDE Plasma 5 Desktop environment. Xfce program is a default X