coldfusion cgi and cookies variables dissappear

I have a coldfusion application which prints data. I would like to access cookie and cgi variables to do some conditional login and troubleshooting. These values are there in the calling program (cgi.remote_addr or cookie.something) but are gone in the print program. I have commented out statements like:
<cfheader name="pragma" value="no-cache">
 <cfsetting showdebugoutput="no">
...but does not help. Also, the calling program is building the url to the print program dynamically
and using cfhttp to call it.

Who is Participating?
C4S-DTConnect With a Mentor Commented:
You simply need a wrapper.  I can't take credit for authoring the solution, but I will point you there!
Fellow CF Nutcase (and a talented one at that), Ben Nadel,  has written an elegant solution that could serve your purpose quite well.

I'll let his words explain it - but here's the link:

Gurpreet Singh RandhawaWeb DeveloperCommented:
where you try to call your print statement page:

use <cfdump var="#cgi#"> and <cfdump var="#cookie#">

thry with the code u commented out and try it also with code inside there too. See what is the difference u get

once done come and we will check again
cfhttp is opening a different session, so session values would not be available

Also, is your cfhttp calling a different domain?  If so, the values would not be available across domains.

How about reading these values and pass them using cfhttp parameters instead
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.