How to permanently disable the "save session" feature in Xubuntu?

I’m running Xubuntu 13.10 with xfce4-panel 4.10.1 and my sessions keeps getting saved involuntarily. I’m well aware that this is a bug so I’d like to ask if anyone knows a workaround to permanently disable/delete this feature (by removing/editing some files maybe)?

I’ve spent hours searching and tried a lot of the methods already but none of them worked, or at least were not permanent. Some of the stuff I’ve tried:

How can I turn off Xfce session saving system-wide?

(This basically just removed the tick-box in the logout prompt)

Xubuntu reopens last session applications even though it shouldn't

(Deleting the cached sessions was not a permanent solution)

I would greatly appreciate your help!

My temorarily solution:
I created a simple bash script and placed an
application launcher (which runs the script when pressed) on my task
panel. The script will delete the “~/.cache/sessions” directory and
promt log out.

The script can be found here:

Basically this will be the button which you use to logout/reboot/shutdown.

Update: This only occurs if you added “restart” to the listing, in your “Action Button” (the button with your username written on). If you restart using log out -> restart it should reboot normally and not save your session. Thus, the temporarily solution above is not necessary, I will leave it there as a reference.

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

The solution is two-step.

  1. Disable Automatically save sessions on logout in Settings > Sessions > General > Logout Settings. Also make sure that you disable Save session for future logins in the Logout prompt (the window that pops when you actually try to logout).


  2. You need to log out, delete the contents of ~/.cache/sessions, then log into a clean session. (You can also delete your current session via Settings > Sessions > Session > Clear Saved Sessions.)


Solution 2

Delete existing sessions:

$ rm .cache/session/*

Make directory read-only:

$ chmod -w .cache/session

You can enable session-saving by granting Write right on the directory:

$ chmod +w .cache/session

(Tested with Xubuntu 14.04)

Solution 3

I’m sorry if it isn’t answer, but I can’t comment.

I have had same problem with that bug. And I “resolved” it by using “delete part” of your script:


#edit.1: It will be launched by root, so we have to use full path here.

    # Deletes whatever is in DIR
    rm -r -- "$DIR"

    if [ -d "$DIR" ]; then
        echo "wtf man, it's not there?!"


I execute this-way modified script on reboot and shutdown.

This can be set-up according to instructions on site:

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply