Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 8 down vote accepted

(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:

share|improve this answer
    
Sorry for taking so long to accept, I didn't want to accept without having tried it out, and I wasn't doing maintenance on that server again until now. –  Jasper Jun 1 '13 at 13:11
    
Works perfectly, thanks. –  Henry Gibson Aug 25 '13 at 8:02
    
It seems that it doesn't work anymore with 4.10.1-1ubuntu1 under Xubuntu 13.10. Before the upgrade everything was ok :-( –  Daniel Alder Nov 12 '13 at 22:35
    
@DanielAlder It still seems to work for me, as I am using the Xfce 4.10 ppa on 12.04; the update you mention is the Xubuntu 13.10 update I think. The kiosk option still seems to be enabled in the source and there are no patches disabling it, so it's very strange. –  user76204 Nov 14 '13 at 0:37
    
@Mik: the kioskrc still hides the 'save session' button, but funnily one out of 4 times after logging out and in the open windows which I had come back. –  Daniel Alder Nov 14 '13 at 22:07

I ran into the very same problem, but the solution provided by @user76204 didn't do the trick for me.

My Details

$ uname -ir && lsb_release -a && xfce4-about -V

3.13.0-24-generic x86_64 No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04 LTS Release: 14.04 Codename: trusty xfce4-about 4.11.1 (Xfce 4.10)

My Solution

I fully admit that this is an ugly, ugly hack

  1. Clear out the sessions directory:
    find "$HOME/.cache/sessions" -type f -print0 | xargs -0 rm -f
  2. Remove write permissions by setting octal permissions on "$HOME/.cache/sessions"
    chmod 500 "$HOME/.cache/sessions"

Thus, sessions cannot be saved. This approach does have one advantage, however: Should you want something set in a session at a later date:

  1. Reset the permissions on the folder
    chmod 700 "$HOME/.cache/sessions"
  2. Fire up XFCE session manager:
    xfce4-session &
  3. set/save/configure whatever...
  4. Save the session
  5. Remove write permissions by setting octal permissions on "$HOME/.cache/sessions"
    chmod 500 "$HOME/.cache/sessions"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.