Fix CSRF attacks against the preferences and edit forms. Closes: #475445