I have the following code in website1.com:
<script type="text/javascript">
document.cookie = "qwe=1";
alert(document.cookie);
</script>
and website2.com contains:
<iframe src="http://website1.com"></iframe>
When I open the page website2.com in IE it alerts empty string (if no cookies was set before).
Other browsers alert “qwe=1”.
So the question is why and how to workaround this?
It is about security in IE.
If you want allow access to cookies in IFRAME, you should set HTTP header as follows:
ASP.NET:
JSP:
PHP: