I don't know if this behavior is true for both IE and Firefox, but I use FF and when that happens to me on this board, I use the browser back button (my text is still there, so I usually click in the textarea, Ctl-a to select all, and Ctl-c to copy, just in case), then I click the reload page button to renew my session (the text is still almost always still there, which was a surprise the first time, but a pleasant one), and the post goes through when I resubmit the page.
Like several of the others here, I often compose long messages in a text editor, because my exchange and yahoo email editors will lose messages when they timeout.