开发者

Cross-Domain Cookie Problem

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 t开发者_运维知识库his so it works properly? I thought A.com and B.com are in the same-origin policy ?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜