How to display messages to the user after a POST + HTTP redirect

后端 未结 6 1962
执念已碎
执念已碎 2020-12-08 10:52

I’m using the PRG pattern to avoid multiple form submission. It has, however, a serious drawback — you cannot simply echo the confirmation message to the user (

6条回答
  •  佛祖请我去吃肉
    2020-12-08 11:19

    I use the session variable method. I don't really like embedding error messages for display in the URL, especially with the URL-saving/sharing issues you note, and I like that if the user reloads the destination page it'll be a clean instance.

提交回复
热议问题