9 Replies Latest reply on Dec 3, 2016 8:18 AM by cfrookie_coder

    Change in back button behavior

    PapaMech Level 1

      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

        • 1. Re: Change in back button behavior
          BKBK Adobe Community Professional & MVP

          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.

          • 2. Re: Change in back button behavior
            PapaMech Level 1

            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

            • 3. Re: Change in back button behavior
              BKBK Adobe Community Professional & MVP

              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.

              • 4. Re: Change in back button behavior
                BKBK Adobe Community Professional & MVP

                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.

                • 5. Re: Change in back button behavior
                  cfrookie_coder Level 1

                  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. 

                  • 6. Re: Change in back button behavior
                    EddieLotter Level 3

                    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

                    • 7. Re: Change in back button behavior
                      rogerm2393677 Level 1

                      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.

                      • 8. Re: Change in back button behavior
                        Steve Sommers Level 4

                        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.

                        • 9. Re: Change in back button behavior
                          cfrookie_coder Level 1

                          Actually, that's not true.  rogerm's fix worked for us.  We changed the CF setting and it works right now.