If ColdFusion is Still Your Thing...

in #steem7 years ago (edited)

Adobe ColdFusion
Image: found on google

Found a simple way to prevent form resubmission from page refresh and back button.

Here's how I have mine set up:

  • Enable sessionManagement on Application.cfm
  • Seperate form, action, and completion pages

then add this line on the top of the action handler cfm (insert,delete, etc)

<cfif structKeyExists(session, "submittedAlready")>
    <cfset structDelete(session, "submittedAlready")>
    <cflocation url="index.cfm" addtoken="false">
<cfelse>
    <cfset session.submittedAlready = "true">
</cfif>

Done! No resubmission.

FYI, I'm no expert in ColdFusion. Just wanted to share this with all the newbies out there like myself.

Follow me if you liked it, Upvote if you loved it. Cheers.

Sort:  

Thanks for sharing!

I'm one of those rare devs who still writes CFML, though I've long since moved from ACF to Lucee. Haven't seen much CF content on here so here's to more!

Great to hear! I think that getting good CF content is hard these days...

Nice post! I will follow you from now on.

Congratulations @shawnycx! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Congratulations @shawnycx! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Congratulations @shawnycx! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

Upvote this notification to help all Steemit users. Learn why here!