I am unable to understand how iframes can access cross domain cookies. eg. i have 2 domains abc.com and xyz.com , i have the parent frame at abc which is calling an iframe from xyz, the the iframe from xyz has a code to read cookies(not http-only) and send it via postMessage response.
It is not clear to me if an iframe is loaded into the parent frame isn't it if the code calls document.cookie in the iframe(as it is currently loaded on my machine) would emit cookie on my machine and not the one stored on xyz.com
I was looking at the openid connect documentation and they do something like this.
The implementation is kind of described here : Accessing cookies of an iFrame in parent window