Value of $this->referer() if iframe redirects a parent

We have several links that used to work. We are now consolidating all those links into a single link that opens a modal box with the aforementioned links as options into an iframe.

Upon selecting any option, the page should redirect a desired URL (I handled this with parent.location.href=). One such target URL handles the request and redirects to the caller.

When I try to implement this, the value of $this->referrer() on the controller side is that of the modal box. I expect this to be the Path of the parent URL.

I am not able to figure this out and any help would be appreciated.

Thank you and cheers.

$this->referer() is taken from referer field from request which is populated by browser, not much cake can do about it