Does anyone know of an easy way to embed an ACF CF...
# cfml-general
p
Does anyone know of an easy way to embed an ACF CFML page in an iframe? The page loads, but sessions / cookies aren’t. I’ve tried J2EE and Redis sessions. I’ve tried storing session information in memory, in cookies, and in client variables. Nothing seems to work. Am I missing something obvious?
d
Are you saying the main page and the iframe page create two separate sessions?
j
@pegarm Perhaps you could pass the parent cookies of the session as URL variables. I know this is done for API calls.
p
@Daniel Mejia I’m saying that the main page is on mydomain.com and is iframing a page within myotherdomain.com.
@jakobward Yeah, I was trying to avoid exposing CFID/CFTOKENs in URL variables, but that was a thought I had as well. I may have to bite the bullet.
m
are mydomain.com and myotherdomain.com using the same application scope? Sessions are loaded in the app scope.
further, cookies are domain specific
Assuming the answer to the first question is no, and given the second, about the only choice you have is to pass some kind of token across domains, and store the data you want to share in a database using the passed token to access it. my .02
p
Thank you all for the insight!
m
If you control code on both hosts, you could perhaps use some postMessage() flow initiated from within the iFrame and accessing an endpoint on the parent in order to sync sessions between the two. That would definitely be much cleaner than passing CFID/CFTOKEN in URL variables. Here's a guide on the topic of postMessage to get you started: https://www.htmlgoodies.com/html5/display-cross-domain-data-using-postmessage/