Go to System > Preferences > Startup Applications, click the Options tab, and check the checkbox reading "Automatically remember running applications when logng out". You can also set the startup programs manually on the "Startup Programs" tab.
I think you just googled it which I did before I write here also. This doesnt work for Debian. I don`t see any preference page or the options you said above.
So I found this https://github.com/johannesjo/linux-window-session-manager which seems pretty good and would probably do what I need. But it keeps giving errors and doesn`t restore everything correctly.