Copy link to clipboard
Copied
Hi,
I am very new to ColdFusion, and have been experimenting with the different ways to "call" a JSP from CFML. I'm currently running ColdFusion 8 Developer deployed on GlassFish 3.1.1 (on Win2K3 64-bit).
Thus far, I have been looking at GetPageContext().include and .forward() and using <cfhttp>.
I have some basic test scenarios working, but in my case, we are using a single sign-on product, Oracle OAM, and I'd like to (need to) be able to pass some of the cookies (e.g., the SSO cookie) that are on the incoming (to the .cfm) request through to the "called" JSP.
I know, that for example, with <cfhttp>, I can set parameters to set headers, but how can I (1) get the (for example) "Cookie:" header from the incoming request, and then set that into a parameter for <cfhttp>?
I also have a similar question in the case where GetPageContext().include() is used, rather than <cfhttp>.
Example code/snippets to do this would be greatly appreciated!!
Thanks,
Jim
You can retrive the incoming cookie from the cookie scope and add it to the cfhttp request as another cfhttpparam
<cfhttpparam name="cookiename" type="cookie" value="#cookie.incomingCookieName#" />
jason
Copy link to clipboard
Copied
You can retrive the incoming cookie from the cookie scope and add it to the cfhttp request as another cfhttpparam
<cfhttpparam name="cookiename" type="cookie" value="#cookie.incomingCookieName#" />
jason
Copy link to clipboard
Copied
Jason,
So, for example, if the cookie name on the incoming request is "MyCookieIn", and (for example) I want the cookie to go out with the request that gets caused by the <cfhttp>, but named as "MyCookieOut", then all I need to add is a <cfhttpparam> like:
<cfhttpparam name="MyCookieOut" type="cookie" value="#cookie.MyCookieIn#" />
and then when the <cfhttp> "happens", there'll be a cookie on the outgoing HTTP request named "MyCookieOut"?
Sorry for the (detailed) newbie question, but if that's all there is to it, it is SO cool !!
I thought that I'd have to dig into something like <cfscript>, etc. to pull the cookie out from the incoming request, etc., and was kind of dreading that ...
Jim
Copy link to clipboard
Copied
Yeah, that's it.
jason
Copy link to clipboard
Copied
Jason,
I tried what you suggested, and it worked perfectly!
Thanks,
Jim