I don't really have an idea why you get logged out … When you are on the forum page where you want to post and you are logged in, this status could only change when changing the page. It does not happen that the login status in the upper right corner of the window changes itself only during writing. In the settings there are no options to save the login for a special time, so … no idea about that.
But I have a workaround for the inconvenience of writing your post again from memory. I do it most time myself, just in case of … When your cursor's still in the posting frame, press CTRL+A (marks all) and then CTRL+C (copies the marked into your clipboard). If you'd have to "write it again", just put your cursor in the posting frame and press CTRL+V (fills your clipboard into the window). 