MacBook Air logs off automatically since Yosemite
According to this Apple support article: Set your mac to log out when not in use - installing Yosemite turns on the "log off after 60 minutes of inactivity" feature. 

To turn it back off, click on the "Advanced" button at the bottom of the "Security and Privacy" window and uncheck the option. You should be good to go!