Change in back button behavior
Copy link to clipboard
Copied
We are upgrading from ColdFusion 9 to ColdFusion 11. We noticed a change in back button behavior. On pages running CF 9 the back button works, but on pages running CF 11, when clicking the back button, we get a browser "confirm form resubmission" message. Since it is the same browser, it is clearly a change in ColdFusion. Does anyone know when the change was made? Is there a setting that controls the behavior?
Thank you,
David
Copy link to clipboard
Copied
Coldfusion cannot be blamed here. It communicates only indrectly with the browser, through the web server. Even so, it is likely that the change in back-button behaviour is in the browser itself. It is warning you that you are about to resubmit the form which, in many ways, is quite nice of the browser.
One obvious 'setting' you can use to prevent the back-button behaviour is redirection. For example, you may, after processing the form variables on the action page, use cflocation to redirect to another page.
Copy link to clipboard
Copied
Hi BKBK,
Thank you for taking the time to reply.
Sorry if I was not clear. I have the same pages running on production on CF9 and in development on CF11 (as we are getting ready to upgrade our servers). On CF9 the back button works. On CF11 we get the form resubmit warning. I've tried this with Firefox and Chrome. Because the differences are the version of ColdFusion and the environment (production / development) the cause is either a change in ColdFusion after CF9 or some (CF admin or IIS) setting.
Thanks,
David
Copy link to clipboard
Copied
We should ignore the difference in Coldfusion version for a moment. It might just be that the previous behaviour was incorrect and what you now observe, with CF11, is the correct behaviour.
A form-resubmit warning is essential. In fact, it can even be vital in certain circumstances. It is telling you that someone, some process or some thread has attempted to resubmit a form.
In your case, clicking the back button apparently refreshes the action page of the form. This is analogous, in business terms, to repeating an order that has already been placed. The related validation code, queries, etc. will run once again. Obviously an unwelcome situation.
Copy link to clipboard
Copied
How can you turn this behavior off? We're just upgrading from CF9 now and this new "feature" is very annoying for our internal applications. There's no business risk. We don't want the form to be resubmitted either, we just want to go back one page.
Copy link to clipboard
Copied
Can you provide simplified ColdFusion files that reproduce the problem? (Including the Application.cfc)
It would be helpful if others can test the scripts in their environment to see what happens.
Cheers
Eddie
Copy link to clipboard
Copied
I think we've found and fixed the issue for us. Our breakthrough was this article: Pavan's ColdFusion Blog: CF11 is setting cache-control and expires headers
We had installed CF2016 using the Developer Profile, and it appears that in doing that, CF was sending cache-control headers with each response. Not sure which header was causing the issue, but "must-revalidate" was a likely issue.
Anyway, the fix for us was to go into CF Administrator >> Debug & Logging >> Remote Inspection. Uncheck "Allow Remote Inspection" and submit the change. I hope this helps.
Copy link to clipboard
Copied
I fought the same anomaly going from a CF10 server to CF2018 - this setting change on our dev server solved the issue as soon as I save the change in the CF admin.
Copy link to clipboard
Copied
Basically you can't turn on/off this behavior. If the page you are going back to was produced as the result of a POST request, you get the re-post warning.This is a browser function, not CF.
Now the CF admin pages may have changed between CF9 and CF11 where CF11 simply displays the page after POSTing whereas CF9 may have acted on the POST and then performed a page redirect to the final page being displayed. If this is the case, I doubt very much Adobe would rewrite this logic simply to accommodate the back button.
Copy link to clipboard
Copied
Actually, that's not true. rogerm's fix worked for us. We changed the CF setting and it works right now.
Copy link to clipboard
Copied
Still, the question remains why a certain behaviour is switched on in CF11, and off in CF9. Could you show us the code of the form page and action page, by private message if necessary.

