It's frustrating when you've spent a while typing a thoughtful reply only to have it go *poof*, isn't it?
Rin explained what happened.
If you check the 'remember me' box when logging in, I think that works too. That will certainly stop you being thrown out after a period of inactivity (so if you wander off to make a cuppa and the doorbell goes etc., etc., when you return, you should still be logged in). However, if you are typing a long post, it's always best to type it elsewhere (Notepad, Wordpad, Word) in case the site crashes. Then simply copy/paste in when you're done.