I understand your frustration exactly
Its happened to me, but not on this forum.
It always happens when you have just written a masterpiece, of course. Youve spent ages writing, go to post, and it fails.
On this forum, there is a switch when you log-in.
The default is something really silly, like 30 mins.
You can change that value.
Theres another checkbox at log-in - Forever
I use that. Result? No nasty surprises!
Another tip, if it happens here or on another forum.
After it fails, use the Back button on your browser.
The window with your message may re-appear.
You can then Copy it and save it - to WORD, Notepad etc, login again and post.