How do I expire a page once a form is submitted in symfony2?
Sometimes our users are using the back button and re-submit the form. I would like to inform them in case a form has already been submitted that they should not re-submit it.
Sometimes I see on web-pages that the session is expired (when i do online banking for example). when exactly should this be implemented? Would it be appropriate to have it in my situation?
A simple technique I use to achieve this ad-hoc is a sort of custom csrf session variable.
First add a variable to the session after form submission and then if on page load that variable appears you know they've clicked back.
On the post-submitted page controller add:
And on the actual form page's controller: