Oh, boy, has it happened to me. Entirely too fucking often. As for how to fix it, I'm not sure. However, saving the username and password doesn't keep errors from occurring, like when you log in to post, and as you try to post, it logs you out in between pages, sending you to a (mostly) blank white page with some URL on it (the only part of the page that isn'twhite).
It's annoying as fuck, and luckily for me, I'm not having that problem right this second.