Question

I'm getting this Confirm Form Resubmission error in the Controller while going back to the browser.

Screenshot1

No errors found in Logs and Console. I'm getting this below in headers, in the Network tab.

Screenshot2

Can anyone tell me why this error is coming? and suggest me a solution.

Was it helpful?

Solution

in php we use POST and GET method for submit data

if we use POST method then form data will be submit in Form data parameter when you come back from browser that time it will not call your controller for Action directly submit form Again based on Form data parameter so you will get Error like

Confirm Form Resubmission

Suggest you to use GET method insted of POST so your data will be keep data in URL so does't submit form on back.

Please Refer https://stackoverflow.com/questions/6833914/how-to-prevent-the-confirm-form-resubmission-dialog for more details.

Please not :- There are some disadvantage of GET method please read and take care of it.

OTHER TIPS

This isn't Magento causing an error, rather your browser (Chrome) warning you that you are resubmitting the exact same data in a (POST) request. Firefox does the same:

Firefox resend data warning"

It's not isolated to Magento sites either, any site that you press the browser back button in after making a POST request will warn you of the same.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top