发布后重定向到同一页面,但显示“成功”消息

Recently I found out my system of post/redirect is flawed, and I see no alternatives to fix it. Consider this step by step scenario, which has to work without javascript/ajax:

  1. Admin goes to a forum page, browses a specific thread.
  2. He deletes the thread.
  3. The system sends his deletion request to a deletePost.php
  4. After the form is processed, deletePost.php shows a "thread successfully deleted page", and does a header Refresh after a few seconds back to the original thread page.
  5. Because we are refreshing to the same page (either with an HTML head tag, or a header(Refresh:time, url=url), when the user presses F5 he will get the "Confirm form resubmission" message.

    I can't find an alternative to get me out of this situation where it asks to resubmit the form. Here are some alternatives and why they are also flawed:

  6. Do a non refresh php header() redirection. Form resubmission is gone, but now I can't show the user a "success" message, which makes it look strange.

  7. Append a ?success GET var when redirecting back to the same page. This works because essentially we redirected to a new page. But if the user hits F5, the success get var will remain there forever. Also, if the user decides to moderate again, he will be redirected to the same page with the same get var, making Form resubmission happen all over again.

  8. Save on a session variable a successful message, and load it on a redirected page, then do a timed refresh redirection to the original page. The problem with this is that session flash messages are very unreliable when the user is moderating many tabs at once. The messages from different pages would not know which tab they belong to. People who don't use cookies would get no messages as well.

    Is there any elegant way out of this without relying on javascript?

I personally prefer the idea of storing flash messages in the session.

$_SESSION[messages][$id] = array(
  'type' => 'success',
  'content' => 'Deleted.
)

The id is your Threads ID.