Cookie未在IFrame内的IE浏览器中保存 [英] Cookie is not getting saved in IE browser inside IFrame

查看:163
本文介绍了Cookie未在IFrame内的IE浏览器中保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在其他网站的IFrame中使用我的网站。



一切工作正常,但我面临IE浏览器的问题。



Cookies未在IE浏览器中保存。



我尝试过使用其他浏览器(Chrom,Firefox等)并且使用相同的代码工作正常。



当我直接运行我的网站时,同样的代码也在IE中工作。



下面是我放置的IFrame的代码片段。



Hello All,

I am using my website inside IFrame from another website.

Everything is working fine, but I am facing an issue with IE browser.

Cookies are not getting saved in the IE browser.

I tried with other browsers (Chrom, Firefox etc.) and it's working fine using same code.

Same code is also working in IE, when I run my website directly.

Below is code snippet of IFrame that I placed.

<iframe id="myiFrame" src="mywebsite.com "

        style="border:0px;-webkit-overflow-scrolling: touch;overflow: auto; fub;" name="myiFrame" scrolling="no" frameborder="0" marginheight="0" marginwidth="0" height="1220" width="100%" seamless ></iframe>





以下是保存cookie的代码片段





Below is the code snippet of saving cookie

System.Web.HttpContext.Current.Response.Cookies(fname).Value = fval
System.Web.HttpContext.Current.Response.Cookies(fname).Expires =              DateTime.Now.AddDays(fdays)





请就此提出建议。



关于此问题的任何回复欢迎。



如果您对此有任何疑问或疑问,请与我们联系。



谢谢

Advay Pandya



Please advise on this.

Any response on this issue is welcome.

Please let me know if you have any concern or query on this.

Thanks
Advay Pandya

推荐答案

http://stackoverflow.com/questions/389456/cookie-blocked-not-saved-in-iframe -in-internet-explorer [ ^ ]


大家好,



任何人都可以告诉我这个问题?



谢谢

Advay Pandya
Hello All,

Can anyone please advise me on this issue ?

Thanks
Advay Pandya


大家好,



我对此做了一些研究并得到了解决方案。它现在正在工作。



@ F-ES Sitecore:你建议的链接非常有帮助。谢谢



请找到我解决问题的步骤:



1)生成p3p政策文件。请参阅以下链接并按照相同的步骤操作。他们以非常简单的方式解释了。



http://www.jinweijie.com/asp-net/fix-ie-blocking-iframe-cookies-problem/ [ ^ ]



2)我们需要3个文件:.xml,.p3p和.txt。上面的链接将有助于生成所有3个文件



3)在网站的根路径中创建一个目录(w3c)。



4)将所有3个文件放在目录中(p3p.xml,privacy_policy.p3p和privacy_policy.txt)注意:文件名无关紧要。只有比赛很重要。



5)在母版页面加载中添加请求标题



< b> VB

Hello All,

I did some more research on this and got the solution. It's working now.

@F-ES Sitecore: The link that you suggested is really helpful. Thanks

Please find the steps that I followed to sort out the issue:

1) Generate p3p policy file. Please refer below link and follow the same steps. They have explained in very simplified manner.

http://www.jinweijie.com/asp-net/fix-ie-blocking-iframe-cookies-problem/[^]

2) We will need 3 files: .xml, .p3p and .txt. Above link will help to generate all 3 files

3) Create a directory (w3c) in root path of the website.

4) Put all the 3 files inside the directory (p3p.xml, privacy_policy.p3p and privacy_policy.txt) Note: Name of file doesn't matter. Only contests are important.

5) Add a request header in page load of master page

VB
HttpContext.Current.Response.AddHeader("p3p", "CP=" & ControlChars.Quote & "IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT" & ControlChars.Quote & "")





c#





c#

HttpContext.Current.Response.AddHeader ("p3p", "CP = \" IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT \ "");





6)现在,清除IE的所有cookie并重启浏览器。



完成上述所有步骤后,它将正常工作。



如果有,请告诉我们任何人都希望更加迅速。



谢谢

Advay Pandya



6) Now, clear all the cookies of IE and restart the browser.

It will be working after completing all the above steps.

Please let me know if anyone wants more celerity on this.

Thanks
Advay Pandya


这篇关于Cookie未在IFrame内的IE浏览器中保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆