Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8941859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:23:47+00:00 2026-06-15T11:23:47+00:00

Running ColdFusion 7. The Application.cfm loops all session variables into request.session The OnRequestEnd.cfm loops

  • 0

Running ColdFusion 7.

The Application.cfm loops all session variables into request.session

The OnRequestEnd.cfm loops all request.session values back into session

It does this so it only needs to lock the scope once when writing the variables in a single transaction. (I believe this isn’t so much an issue anymore? Yet I can’t exactly rip it out).

I have a ‘redirect.cfm’ page which either provides a 301 redirect to an SEO URL or delivers the content. Some forms post to the old URL, so need a 301 redirect which causes the loss of POST data. This is how I intended to handle it.

<!--- if form scope exists (posted data) copy it to the request.session scope ---> 
<cfif structKeyExists(form,'fieldNames')>
    <cfset request.session.postData = structCopy(form)>
</cfif>

Then it moves on to a 301 redirect, and when it comes back to redirect.cfm to deliver the content it runs this code

<!--- if request.session.postData exists (posted data) copy it to the form scope --->
<cfif structKeyExists(request.session,'postData')>
    <cfset form = structCopy(request.session.postData)>
    <cfset StructDelete(request.session,'postData')>
</cfif>

This works fine if a 301 redirect is not needed from post of data.

With a 301 redirect, I have confirmed the Application.cfm, OnRequestEnd.cfm both run twice (once for the initial 301 and once for the content delivery).

By the end of the first OnRequestEnd.cfm call session.postdata is populated correctly with the form data.

After the 301 redirect and it hits Application.cfm again the session.postdata returns ‘struct[empty]’

Any help? Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:23:48+00:00Added an answer on June 15, 2026 at 11:23 am

    structCopy() creates a shallow copy of the structure, meaning that nested structures are by reference only which is why your simple values persisted but your nested structures did not. Once your form structure no longer contained data your postData structure began referencing an empty structure so your reference is also empty.

    To do a “Deep Copy” of your structures use duplicate()

    See also other structure functions

    CF 9 documentation for deleting structures

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running ColdFusion 9.01 with all the latest hotfixes applied as of this
I am running ColdFusion 8 application servers on Windows machines. ColdFusion is running as
I have a coldfusion application running right now with a login that sends a
I have an application that uses coldfusion's session management (instead of the J2EE) session
I've started using ORM in Coldfusion 9, but I'm running into an issue in
Suppose I have logged into an application which is running from IIS . Now
I inherited a coldfusion MX7 application that has a long running process, which the
I'm running 2 separate sites/Applications under a single install of ColdFusion. The execution time
We are running ColdFusion MX7. One problem we have is that we have a
I have a server running on the Amazon cloud running ColdFusion 9.0.1. on Windows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.