Really? Have you tried hitting the back button?
I usually then get the text I had typed. I then copy it, log in, paste it.
So, your problem seems to be that you're getting logged out while you still have the tab open? The only reason for that - that I'm aware of - is an unstable network connection that disconnects you for short periods (maybe even so short that you don't realize it).
Strange issues you all have.
You might have a look here, if you're not coincidentally the topic starter:https://support.mozilla.org/en-US/questions/972105
Best bet seems to be clearing the cookies.sqlite file (please refer to the links for how to do that, I'm only giving a direction here what to look for)