Reading IFrame Cookies

I created an iframe and I uploaded a site to it (I do not have access to this site - it was not written by me)

<script type="text/javascript"> var el = document.createElement("iframe"); el.setAttribute('id', 'ifrm'); document.body.appendChild(el); el.setAttribute('src', 'http://AWEBSITE.com/'); alert(document.getElement("iframe").cookie); //This doesnt work..... </script> 

Is there any way I can use javascript to read my iframe cookies?

+4
source share
1 answer

This is not possible due to the same origin policy . Do you really want someone to be able to stick with an iframe on any page, point to any domain and receive cookies?

+9
source

All Articles