How do I set cookies from outside domains inside iframes in Safari?

前端 未结 5 1661
梦毁少年i
梦毁少年i 2020-12-08 10:55

From the Apple developer faq

Safari ships with a conservative cookie policy which limits cookie writes to only the pages chosen (\"navigated to\

5条回答
  •  眼角桃花
    2020-12-08 11:20

    localStorage, supported by safari and all modern browsers, permits read/write operations even on pages loaded into iframes. if you don't mind dropping support for ie6 and ie7, try using localStorage instead of cookies in your framed site. i know your question specifically says you don't have access to code on the framed site, but for those who do, localStorage definitely solves the "no cookies in a safari iframe" problem.

提交回复
热议问题