I use Ubuntu 18.04. When I close my laptop, and open it again, I find all my previously opened programs are lost. My Power configurations has "Off" in the "Automatic Suspend". Also, in "When the Power Button is pressed" I have "Off". But closing the laptop is not pressing the power button.
The lid close action seems to already be set to "suspend":
$ gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend'
This is very annoying. I want to close my laptop (i.e., closed the screen. This is different from pressing the power button) and find all my previously opened programs.