Another way to make sure work isn't lost is to save it in browser storage when available. This would also work in case connection is lost.
Why not save the content as a 'semi-anonymous' user, together with the user's session cookie and on the next login tell there's some ghost session lurking around and whether it should be kept?