So your Mac keeps logging you off automatically? After about 30 minutes?
My work iMac, running OS X 10.9.5 Mavericks, kept logging me off after a period of a half hour or so. I would leave my desk for a meeting, say, and come back to find me logged out and all my applications closed. Grindingly frustrating.
After lots of searching, I finally found the solution – almost by accident.
Head to Preferences, and the Security & Privacy pane (above).
Go to the fourth tab at the top, “Privacy.” Hit the “Advanced…” button at the bottom of the window.
UNCHECK THIS BASTARD.
Hope that helps!