localhost most likely the CSRF token expired. You can check your Flarum log file or the browser console to check what kind of error it was.
If you select "remember me" at login this shouldn't happen.
We don't have anything to save the post content when you do a full page refresh. However there should be a warning that the content will be lost if you try closing or refreshing the tab.