Preventing Actions With Page Refresh

I am interested in ideas that developers employ to prevent users doing a page refresh hence re-sending Post data. What is perhaps best practice especially within the Yii Framework. Using sessions seems to be a fairly easy method to implement however opinions vary. Thoughts?

This is done by setting flash message, redirect and showing the flash message.

Yes, and if you’re intending to keep the user on the same page, you can use $this->refresh() after setting your flash message in your action.