Click here to Skip to main content
15,889,890 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.

HTML
<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>


Below is the code snippet of saving cookie

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


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
Posted

 
Share this answer
 
Comments
Advay Pandya 24-Jun-15 7:18am    
Hi. Do you know how to implement this P3P policy ?
Hello All,

Can anyone please advise me on this issue ?

Thanks
Advay Pandya
 
Share this answer
 
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
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) 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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900