0
votes

I have a domain A.com [my website] and a remote website B.com which integrates an iframe from my domain [A.com] with a piece of javascript.

I want to share cookies across these domains [within the iframe]? How would I go about doing this so it works properly? I thought A.com and B.com are in the same-origin policy ?

1

1 Answers

1
votes

How is a.com and b.com same origin? They are different domains. You can't share cookies that way. For example:

  • example.com
  • fritters.com

Can not share cookies even if fritters.com is in an iframe inside example.com.

  • fred.example.com
  • www.example.com

can share domain cookies because they are both the same domain (example.com) but have different subdomains, so you can assign the cookie to *.example.com.