I'd like to have my MacBook Pro to automatically log out when it hasn't been used for a certain period of time, e.g., 30 minutes. I defined my System Preferences to do so when it's "inactive" for that period of time. However, it doesn't seem to automatically log out if I close the lid when I'm done working. For example, if I close my lid and my Mac sleeps overnight, opening the lid in the morning shows me the account that was last logged in.
Does sleeping prevent a Mac from logging out automatically? From my point of view, sleeping is the ultimate form of inactivity.
If the above is true, is there a way to make my Mac to automatically log out despite its sleep state? Or could I even force it to log out immediately when it goes to sleep?
I see many questions on this site and other sites that talk about ways to prevent automatic sleep or log-out behavior, but not anything about my issue. FYI, I'm running macOS 10.11 (El Capitan).