How to Turn Off Xfce Session Saving System-Wide

sessionxfcexubuntu

We are working with a terminal server that is running Xubuntu. Because we have had some issues with saved sessions, we want to turn off the saving of sessions completely.

So far, we have been able to set the default to not saving the session, but in the logout screen it is still possible to save the session. Is it possible to turn off session saving completely (system-wide) so our users won't "accidentally" use it?

Best Answer

(Tested with Xubuntu 12.04, but with the ppas for Xfce 4.10 and 4.12 installed, but the option I discuss was available for Xfce 4.8)

There is a way to globally disable the option of saving the session, and the best way to achieve it is to use Xfce kiosk mode. One of the available kiosk mode options, buried in the source code for xfce4-session, is SaveSession. If we look at /home/mike/xfce4-session-4.10.0/xfce4-session/xfsm-shutdown.c, we can see the undocumented setting:

/* check kiosk */
  shutdown->kiosk_can_save_session = xfce_kiosk_query (kiosk, "SaveSession");

Firstly, create the kiosk directory with

sudo mkdir /etc/xdg/xfce4/kiosk

and then create and edit the kioskrc with your text editor:

sudo nano /etc/xdg/xfce4/kiosk/kioskrc

Place the following in your kioskrc:

[xfce4-session]
SaveSession=NONE

Now, save the changes and logout and login again as your user to test it. The checkbox option to save the session should have disappeared.

Before the setting is applied, the box is still available:

enter image description here

Afterwards, with kiosk mode active, the option is no longer available:

enter image description here

If you wish to use kiosk mode to globally disable other settings, such as the ability to shutdown or suspend, etc, see my answer here: