When I start my computer I want that remember my applications opened before close the last session such as Ubuntu, and other distros do normally.
Googling, I see that I can run apps when I start session, configuring the autostart file but I don't want always run the same programs at start, instead I want reopen the programs opened before close last session.
I use Fedora spin with LXDE.
Best Answer
Apparently LXDE doesn't have a proper session manager. However as you've mentioned we can use the autostart file. All we need to do is create a dynamic list of the programs we are running before we exit the desktop.
Here is a little bash script I whipped up that will parse the children of the root X11 window looking for apps to add to the autostart file. It has optional black and white lists. Use the blacklist for things like the window manager or anything you never want to run. Conversely use the whitelist for something you always want to run.
Try running it in a shell to see what the output looks like, then you can see if you need to add anything to the blacklist.
You'll need to wire this up to run somehow before you exit LXDE. Probably by adding a new entry into a menu.
For example:
scriptnamehere.bash > ~/.config/lxsession/LXDE/autostart
As you can see this will rewrite the autostart file each time it is run, hence the need for the whitelist.