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

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).

    See:

  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.)

    See:

    • Xubuntu reopens last session applications even though it shouldn't

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)


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:

#!/bin/bash

#edit.1: It will be launched by root, so we have to use full path here.
DIR=/home/USERFOLDER/.cache/sessions/

delete_sessions(){
    # Deletes whatever is in DIR
    rm -r -- "$DIR"
}

is_directory(){
    if [ -d "$DIR" ]; then
        delete_sessions
    else 
        echo "wtf man, it's not there?!"
    fi
}

is_directory 

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

This can be set-up according to instructions on site: http://en.kioskea.net/faq/3348-ubuntu-executing-a-script-at-startup-and-shutdown

Tags:

Xfce

Xubuntu