33

First time to have MBP retina. My issue on my MBP is when I close my MBP to transfer to another location (house to coffee shop), when I open my MBP I notice that it closes the apps I have open before I leave the house.

I used chrome & opened 4 to 8 tabs, then when I arrived at the coffee shop it open the chrome again but the tabs are not there. It says "Google Chrome didn't shutdown properly" then a button "Click to restore tabs. I open sublime text editor on desktop 2, when I open the MBP the sublime is now located at desktop 1.

It is kinda weird, because my friend and I has the same MBP, but he is not experience this kind of issue. Someone can help me out this?

Summary: "I come back to work the system is locked down (i.e. I have to put my password), which is fine, and all applications are closed. They do however re-start and try to recover the state as I left them."

grg
  • 201,078
justin
  • 431
  • 1
  • 4
  • 3
  • When you are prompted to log in again at your new location, does the screen where you enter your password have an option to "Cancel" at the bottom or "Sleep", "Restart" and "Shut Down"? Trying to work out whether you are being logged out completely or your session is just locked. – Alistair McMillan Jul 27 '14 at 03:25
  • It has "Cancel" & "Guest User". But there is no "Sleep, Restart & Shut Down". @AlistairMcMillan – justin Jul 27 '14 at 03:27
  • So you definitely aren't being logged out then. Strange. Is this something that just happened once, or has it happened repeatedly? – Alistair McMillan Jul 27 '14 at 03:29
  • Uhmm.. Can't totally remember. What if there is a "Sleep, Restart & Shut Down"? So meaning I'm being logged out completely. @AlistairMcMillan – justin Jul 27 '14 at 03:30
  • It happened repeatedly. But It happened twice that my application aren't closed. @AlistairMcMillan – justin Jul 27 '14 at 03:31
  • If you are being logged out completely, then I'd recommend ticking and then unticking that check box mentioned in our answers. To force the System Preferences application to rewrite its plist file. Just in case the stored setting is corrupted in some way. – Alistair McMillan Jul 27 '14 at 03:33
  • Thank you for the help! @AlistairMcMillan But what if I'm not being logged out? Have you any solution for that? – justin Jul 27 '14 at 03:35
  • I have exactly this problem since Yosemite upgrade. The "log out after" box in unchecked. – David Dahan Jul 04 '15 at 12:27

3 Answers3

64

It sounds like your Mac is set to automatically log you out after a period of inactivity.

Open System Preferences from the Apple menu in the top-left corner. Open the "Security & Privacy" preference pane. Click on the "Advanced..." button in the bottom-right corner. You may need to unlock the pane using the padlock icon in the bottom-left corner.

I think you'll find "Log out after XX minutes of inactivity" ticked. Untick it.

Advanced settings within Security & Privacy

  • 3
    It is unchecked. So probably, that is not the answer. Thank you. @Alistair – justin Jul 27 '14 at 03:19
  • 4
    The good ol' Security and Privacy, the obvious place (not) to find "Log out after [30] minutes of inactivity" option. :) Glad you posted this answer. – qxotk Jan 20 '15 at 23:56
  • Is anybody aware if this settings can be disabled also when using fast-user-switching on macOS? Whenever I untick (or change the number of minutes from) the setting above, and lock the settings, close System Preferences (Cmd+Q) and reopen/unlock it,.. then is always ticked again and reset to 30 minutes. – Kamafeather Sep 20 '19 at 23:46
  • This have been driving me crazy! This was enabled after an os update and wasn't aware this was the reason, I thought this was a major os error. Fortunately this solved the issue. Thanks! – Hugo May 18 '21 at 15:21
7

Summary: "I come back to work the system is locked down (i.e. I have to put my password), which is fine, and all applications are closed. They do however re-start and try to recover the state as I left them."

This sounds like you're actually logging out and back in, whereas what you want is to just require a password when waking (but remain logged in the whole time so none of your apps quit).

Go to System Preferences > Security & Privacy > Advanced... (you might need to click the Lock icon in the bottom left to enable this button). Make sure you have "Log out after X minutes of inactivity" disabled. Then you can enable "require password [immediately] after sleep or screen saver begins."

daGUY
  • 7,813
  • 3
    The "Log out after X minutes of inactivity" is already disabled. From the start it is unchecked. @daGUY – justin Jul 27 '14 at 03:22
3

Since installing Yosemite I was seeing this behavior. Alistair's answer led me to check System Preferences/Security and Privacy. "Log out after" wasn't in the same place as in his posted picture, in Yosemite it has been moved to the privacy tab where I clicked on the "Advanced" button and then saw that the Yosemite install had set a default logout to happen after 60 minutes of inactivity. I unchecked the box and my apps are no longer closing when my mac is put into sleep mode. Problem solved! Thanks, Alistair.