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

**URL:** <https://discourse.cakephp.org/t/value-of-this-referer-if-iframe-redirects-a-parent/4873>\
**Category:** Need Help\
**Tags:** behavior\
**Created:** [September 6, 2018, 3:17am UTC](https://discourse.cakephp.org/t/value-of-this-referer-if-iframe-redirects-a-parent/4873 "2018-09-06T03:17:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul\_ap](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rahul_ap/32/1150_2.png) [@rahul\_ap](https://discourse.cakephp.org/u/rahul_ap)\
**Post date:** [September 6, 2018, 3:17am UTC](https://discourse.cakephp.org/t/value-of-this-referer-if-iframe-redirects-a-parent/4873/1 "2018-09-06T03:17:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Graziel](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Graziel](https://discourse.cakephp.org/u/Graziel)\
**Post date:** [September 12, 2018, 1:44pm UTC](https://discourse.cakephp.org/t/value-of-this-referer-if-iframe-redirects-a-parent/4873/2 "2018-09-12T13:44:16Z")

</div>

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