Solved

Browser back button refreshing coldfusion iframe

Posted on 2016-07-19
6
67 Views
Last Modified: 2016-07-20
I have a page that uses ajax to call an iframe.  The iframe source is a Coldfusion form.  Once I complete the form, if someone navigates to another page and then uses the back button the form submission happens again.

I can't use session variables and cookies, so what can I do?
0
Comment
Question by:trifecta2k
  • 3
  • 3
6 Comments
 
LVL 39

Expert Comment

by:gdemaria
Comment Utility
After the form action processes, do you use a CFLOCATION at the end of the action code to redirect the page?   If you don't try adding it.
0
 
LVL 5

Author Comment

by:trifecta2k
Comment Utility
I don't think I'm following your suggestion.  When the iframe form completes, it puts a message in the iframe.  To leave the page, a user has to click the menu options on the parent page. Then when they hit back it submits the form again.  The iframe is a framework/1 page.  So it uses controllers, services, etc. Unfortunately, I just started using fw/1 and I'm not super familiar with it.
0
 
LVL 39

Accepted Solution

by:
gdemaria earned 500 total points
Comment Utility
Look at the code that runs when the form is submitted.   It probably does some database saves or something like that.   The last line of that code should be a CFLOCATION.   CFLOCATION will do a server-side redirect to a new page.   That new page can show the message.   Using this method prevents a new form submit when hitting the back button.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 5

Author Comment

by:trifecta2k
Comment Utility
Since it's fw/1 it uses framework.setView(the view), I changed it to framework.redirect(the view) and it works. There a few minor tweaks, but it worked!

Thanks.
0
 
LVL 39

Expert Comment

by:gdemaria
Comment Utility
Glad it works.   I have learned to advocate against frameworks.   Every year there is a new framework and that renders previous frameworks outdated very quickly.  Try to find someone that knows the dozens of frameworks that are now out of popularity; some of them are far too complex.  They add an unnecessary learning curve and rarely much benefit.  IMHO.
0
 
LVL 5

Author Comment

by:trifecta2k
Comment Utility
I agree.  I'm not a huge fan of frameworks either.  Thanks again for your help.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now