This is how I solved it.
- Go to System Preferences... > Security & Privacy
- Select the padlock in the lower-left.
A user name/password dialog box will open. If you don't have the correct privileges for your Mac, you may be stuck at this point.
- Enter your user name and password.
The padlock icon will change to an open padlock; The Advanced... button will no longer be grayed out/unaccessible. (See the image below.)
- Select the Advanced... button.
- Uncheck the box proceeding "Log out after _XX_ minutes of inactivity."
- Select OK
- Close the Security & Privacy preferences dialog box.
That did solve the issue for me.
I've heard from others that had similar issues, and what finally solved it for them was to make sure their hard disks didn't go to sleep (found in the Energy Saver preferences).