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.

macOS System Preferences

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).

  • What benefit do you seek from logging out while sleeping?
    – benwiggy
    Commented Mar 16, 2020 at 12:50
  • 2
    The device has multiple users, including young family members who aren’t savvy enough to log out when they are done using it. They just close the lid when they finished with an activity.
    – EJ Mak
    Commented Mar 16, 2020 at 13:36
  • 1
    As for the “benefit,” logging out automatically, it would speed up the time it takes for a subsequent user to log in to their account. Right now, they might have to log the previous user out manually before they can use the device. That takes a lot of time that would best happen when no one is actively using the computer. (Unfortunately, our setup performs poorly when two or more users are logged in concurrently, so that’s not an option.)
    – EJ Mak
    Commented Mar 16, 2020 at 13:43

1 Answer 1


Yes, a sleeping Mac will prevent your account being logged out.

From a running process or application's perspective, time stops while the computer is asleep. Developers of applications need to actively monitor sleep wake cycles and adjust their timers accordingly. Many applications do not.

Third Party Tools

You can use third party software to log out before sleep or after a period of inactivity.

enter image description here

Power Manager, which is a product I work on, is able to trigger a log out on sleep, after inactivity, or immediately upon wake. Given you are running macOS 10.11, be sure to try the appropriate legacy version.

Be aware that performing actions on sleep is generally not advisable.

  • I'm trying a demo of Power Manager Pro 4.6.5. I don't see a trigger option for "when the computer is about to sleep." Can you advise where that option is in the version I'm trying and/or tell me how to craft one using AppleScript or the like?
    – EJ Mak
    Commented Mar 18, 2020 at 16:38
  • The sleep trigger is available in Power Manager's event editor. You do not need the Pro version, as the normal version contains the same Scheduler and legacy licences are still available. Commented Mar 18, 2020 at 20:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .