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.

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: http://pastebin.com/aqx483pn

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.

share|improve this question

3 Answers 3

up vote 0 down vote accepted

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:

share|improve this answer
    
As mentioned, this is a bug. I've already set every single option related to session to off, at those that have a GUI. Thanks for the reply! –  QNBT Mar 2 at 16:06
    
Did you try the non-GUI solution? –  landroni Mar 2 at 19:47
    
Yes, I've been using it as a temporarily solution. The problem is that the sessions keep getting cahed thus the session directory and its file keeps coming back. (gonna update the first post with the temporarily "solution" I'm using now) –  QNBT Mar 3 at 9:00
    
Strange. Did you make sure that you removed the cache after logging out from Xfce? In any case, I'm not seeing this behaviour that you describe (I have the two relevant settings turned off). You may have better luck with 4.12, that you can install from launchpad.net/~xubuntu-dev/+archive/xfce-4.12 . –  landroni Mar 3 at 12:07
1  
I see! thought it was suppose to change. And yes, I double checked the keyboard settings, nothing unusual there. I've also located the real culprit now that I tried it on my other laptop. If you add the "restart" button to the listing in your "action button" and use it, it will automatically save you session upon reboot. However, if you click "restart" via the "log out" menu (xfce4-session-logout) it won't save your session. I just have to avoid using that shortcut I guess. –  QNBT Mar 4 at 18:06

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

share|improve this answer

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)

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.