[乐意黎转载]Safari 3rd party cookie in iframe workaround

来源:互联网 发布:淘宝代销1688发货流程 编辑:程序博客网 时间:2024/05/28 23:11

Safari 3rd party cookie in iframe workaround

The demo: http://vitr.github.io/safari-cookie-in-iframe/demo.html

The problem: site A (main site) loads site B (framed site) in iframe. Site B sets some cookies (e.g. store session data), to function properly. These cookies are called 3rd party cookies, as they are not set by site A.

Safari browser on all platforms block 3rd party cookies by default. 

This is pure javascript solution to the problem. The main idea is to redirect a visitor from the main site to the framed site just for setting a cookie. After that Safari allows to set cookies in iframes for the framed site, as the site has become not a third party any more.

This is very common problem for iframed Facebook applications. Sadly, if you don't have control over site B, you can't apply this solution.

2016 Update

The fix works well with recent Safari 9.1.1 

阅读全文
'); })();
0 0
原创粉丝点击
热门IT博客
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 痣胎记 除 痣 左额头痣 痣 突起 女子额头痣 右额头痣 痣坑 唇痣 手背上面有痣 额头 有痣 额头上面有痣 痣长 痣越来越多 面部长痣 皮肤长痣 大腿长痣 脚下长痣 眼睛周围长痣 额头中间长痣 胳膊长痣 耳长痣 相失交臂 交臂相失 个人交医保 自己交保险怎么交 没有单位怎么交养老保险 医疗保险自己怎么交 养老保险个人怎么交 个人养老保险怎么交 个人养老金怎么交 社会养老保险怎么交 社会保险个人怎么交 社保没交满15年看过来 社保交满15年后死亡 社保可以自己交吗 支付宝交社保 自己交社保 农村社保怎么交 交社保必须停新农合吗 社保要交多少年 公司交社保