Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We want to build an ad-frame which will run on external sites (e.g. YYY.com). The external site will place an iframe to our site (ZZZ.com/ourAdContent.html) and we will show some ads in this frame. The question is, will our iframe have access to the cookies belonging to our domain even when the iframe is on a separate domain?

share|improve this question
up vote 5 down vote accepted

You can't share cookies across domains. You may share across subdomains. So, if your domain wrote the cookie stored on the client - whether in an iframe from other site or stored by visiting your main site, your domain should be able to access it. Otherwise - no.

Here's some good info on the matter (over on SO)...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.