Session Management

Warning

This chapter is definitely under construction, But hold your breath, it will (hopefully) be finished soon.

Session Management in general

The purpose of session management is to provide users a possibility to save and restore their sessions. A session is a collection of applications, all of them having an internal state. This state may be the name of an open file, a displayed image or the score of a game.

Every application that is session management aware connects to one special server: the session manager. A session manager sends commands to his clients telling them to save their state or to terminate. A client must provide the session manager with all information, that is needed to restart the client in the same state, as it is running now. The session manager's task is to take care of this information and to use it when restarting a session. In order to distinguish all clients, the session manager assigns them a unique identifier: the so called client id.

The session management additionally includes a protocol to sync the - so called - interact requests of applications. Suppose you have three applications running. Each of this applications has one file opened, that you have just edited without saving. If you now log out, every application may ask you, whether you want to save your changes or if you want to abandon them. It would be very annoying, if all these three applications would pop up their dialog boxes at the same time. If these three applications have implemented session management in the right way, a new dialog box only pops up, if the previous one has been closed.

GNOME Session Management implementation

The GNOME project uses a special object - the GnomeClient object - to implement session management. This object handles the connection to a session manager, the setting and removing of properties and the handling of messages sent by a session manager.

There are two functions in the GNOME libraries, that create a new GnomeClient object:

GnomeClient *gnome_client_new ();

GnomeClient *gnome_client_new_without_connection ();