Your account has not been hacked (or if it was, it's not related to this problem). You are automatically logged out after 60 minutes by default unless you ticked the box on the login page that says "Always stay logged in", in which case you will never be logged out unless you click the Logout button or clear your cookies (this is a dangerous option if you are using a computer that other people have access to, which is why this option is not the default).
To avoid losing your posts, it is wise to always do a quick Select All + Copy (Ctrl+A, Ctrl+C) immediately before posting, so that you can just Paste (Ctrl+V) it into a new window if anything goes wrong.