Using P3P to set cookies across domains

Source: Internet
Author: User

Sometimes it is not possible to pass parameters on the URL, such as calling an interface on an open platform, which may need to be processed with cookies, but this may involve cross-domain issues.

If the browser opens a cookie support, according to the cookie RFC, it should have:

1. Allow a minimum of 300 cookies to be set;

2, each domain allows at least 20 cookies (ie7/8-50, FF-50, Opera-30);

3. Allow at least 4095 bytes per cookie (Opera-4096 bytes, ff, safari-4097 bytes)

The test example used is to call the IFRAME, assuming that there are two domain names a.com, B.Com, embedded an IFRAME page in A.com's homepage, the SRC address is the http://b.com/setCookie.php page, and then refresh the B.Com homepage to get the cookie.

ASP. NET to set the P3P method:

HttpContext.Current.Response.AddHeader ("P3P", "cp=\" "IDC DSP COR ADM DEVi taii PSA PSD Ivai ivdi CONi His our IND cnt\" ")

PHP to set P3P method:

Header (' p3p:cp= ' IDC DSP COR ADM DEVi taii PSA PSD Ivai ivdi CONi His we IND CNT "');

How to set P3P in JSP:

Response.setheader ("P3P", "cp= ' IDC DSP COR ADM DEVi taii PSA PSD Ivai ivdi CONi His our IND CNT")

ColdFusion How to set P3P:

<cfheader name= "P3P" value= "cp= ' IDC DSP COR ADM DEVi taii PSA PSD Ivai ivdi CONi His our IND CNT '"/>

<?php

Date_default_timezone_set ("Asia/shanghai");

Header ("P3p:cp=cura ADMa DEVa Psao psdo our BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR");



?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.