http://viralpatel.net/blogs/2008/12/how-to-set-third-party-cookies-with-iframe.html
How to set third-party cookies with iframe?
I had problem with the lead base ad click tracking. I was using the iFrame to track the lead information from the advertiser site. But somehow IE is not sending any cookie information from there. Infect firefox also doesn’t send any cookie information for the first request (i.e. when the iFrame src page is called) but if you call any page from the main file (i.e. specified in the source for iFrame like image or script src), I get the cookies.
What are third-party cookies?
If you put your code on other website using iFrame which calls pages from your site, then the cookies groups are called third party cookies (as both the domains, main page source and iFrame source, are different). Other examples of third party cookies are images or other objects contained in a Web page may reside in servers different from the one holding the page. In order to show such a page, the browser downloads all these objects, possibly receiving cookies. These cookies are called third-party cookies if the server sending them is located outside the domain of the Web page.
Some browsers allow third party cookies and in some browsers, like Internet Explorer, it depends on the privacy settings of the browser. In IE6 (Internet Explorer 6) with the default privacy setting of ‘Medium’, third party cookies will be deleted.
As it turns out, there is a simple solution. If you supply a ‘compact privacy policy’ with your page, then IE will treat the cookies with respect and let them through.
The code
Just add this to the start of your page (every page where cookies will be written):
How to set p3p http header in ASP.Net?
HttpContext.Current.Response.AddHeader("p3p", "CP=\""IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""")
How to set p3p http header in PHP?
header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
How to set p3p http header in JSP?
response.setHeader("P3P","CP='IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT'")
How to set p3p http header in ColdFusion?
<cfheader name="P3P" value="CP='IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT'" />
The above code will set P3P (Platform for Privacy Preferences Project) header. It allows the browser (specially Internet Explorer) to through all the third-party cookies (which may be set through iFrame).
分享到:
相关推荐
There’s an art to writing third-party JavaScript – embeddable scripts that can plug into any website. They must adapt easily to unknown host environments, coexist with other applications, and manage...
In this book, the authors describe how to perform multicast, the one-to-many delivery of data to a group of destinations, in third-generation mobile networks. The authors provide an overview of the ...
Bioinformatics-with-Python-Cookbook-Learn-how-to-use-modern-Python-bioinformatics-libraries-and-applications-to-do-cutting-edge-research-in-computational-biology.pdf
In recent times, modern web browsers have become the application ... You will go on to understand how to use third-party Grunt and then create your own Grunt tasks that cater to your particular needs.
Follow bugs through your application to see where the problem is – your own code, third-party libraries, or components used by your application. Understand how applications work Inherited an ...
Apply tests to the third-party plugins you integrate into your site Run tests automatically by using a Continuous Integration environment Use TDD to build a REST API with a front-end Ajax interface
Geopandas, and learn how to use them with Matplotlib. After that, you'll embed and customize your plots in third-party tools such as GTK+, Qt 5, and WXWIDGETS. You'll also be able to tweak the look ...
Brandstetter-insecurity-In-Building-Automation-How-To-Create-Dark-Buildings-With-Light-Speed-wp
这个是合集~一般是这里最全的了 另外加的 PDF是英文的 .为 GCC4.1的HOWTO <br>目录 <br>ADSM-Backup-html<br>Advocacy<br>Automount-html<br>Battery-Powered-html<br>BootPrompt-HOWTO<br>Bridge-......
eu-16-Gonzalez-How-To-Fool-An-ADC-Part-II-Or-Hiding-Destruction-Of-Turbine-With-A-Little-Help-Of-Signal-Processing 安全架构 安全体系 信息安全研究 AI web安全
How to use Third-Party Libraries like jQuery. Who this book is for Beginning JavaScript with DOM Scripting and Ajax is for the person who has a good grasp of HTML and CSS but wants to add JavaScript ...
* Explores GPS, the internet and connectivity, great downloads, how to maximize third-party applications, and application development * Uses graphs, tables, and images to fully explain the features of...
This book is about building cross-... From building a native app, to the backend, to a marketing page, or web app, you will have the knowledge to get hands-on with Swift to build your next big idea.
how-to-write-a-node-cli-tools-with-commander 什么是cli tools? CLI(command-line interface,命令行界面)是指可在用户提示符下键入可执行指令的界面。 早启的unix/linux和DOS都是没有可视化界面的,那内存靠...
You’ll discover how to integrate it with Puppet, Ansible, Jenkins, Flocker, Rancher, Packer, and more with third-party plugins. Then, you’ll see how to use Schedulers such as Kubernetes and Amazon ...
You will learn how to integrate a number of Unix (BSD Sockets), Apple specific (CFNetworking, NSMutableURLRequest, Bonjour) and third party APIs (AFNetworking, MKNetworking) with your own apps. ...
How to use Third-Party Libraries like jQuery. Who this book is for Beginning JavaScript with DOM Scripting and Ajax is for the person who has a good grasp of HTML and CSS but wants to add JavaScript...