response. p3p: Cp = "Cura ADMA Deva psao psdo our bus uni pur int DEM sta pre com nav OTC Noi DSP cor"
This HTTP header is required for p3p security. P3p detailed description of http://www.oreilly.com.cn/book.php? BN = 7-302-07170-5 Microsoft's explanation of this: http://support.microsoft.com/default.aspx? SCID = KB; en-US; q323752
A more lightweight solution
Sohu's Pass Scheme allows users under each domain name to log on simultaneously easily. How
message sent by the Browser contains the host Request Header domain, as follows:
HOST: http://www.guet.edu.cn
The default port number 80 is used here. If the port number is specified, it is changed to: Host: Specifies the port number.
HTTP Response Header
Use Fiddler to view the response header and click inspectors tab> Response Tab> headers, as shown in
We also classify headers as fiddler, which is clear and easy to remember.Cache header domain
Date
Purpose: specify the time and date when the
good:Add a p3p header to the response.Response (). addheader ("p3p", "cp = \" idc dsp cor Cura ADMA our ind PHY onl com sta \"");
CP = "xxx xxxx" has specific meanings:CP is the meaning of Compact into ies,In addition, the header value can also be policyref = "http: // myhost/p3p/policyreferences. xml", which is to specify a policy file.
For details, see here.
The following is the specific range and meaning of the value of the extracted compact polic
the time and date when the message is generated.
Example: Date: sat, 11 Feb 2012 11:35:14 GMT
Expires
Purpose: The browser uses the local cache within the specified expiration time.
Example: expires: Tue, 08 Feb 2022 11:35:14 GMT
Vary
Purpose:
Example: vary: Accept-Encoding
Cookie/login header domain
P3p
Purpose: set the cookie for cross-origin access. This can solve the problem of cross-origin access cookie for IFRAME.
Example: p3p: Cp = Cura ADMA
: specify the time and date when the message is generated.
Example: Date: sat, 11 Feb 2012 11:35:14 GMT
Expires
Purpose: The browser uses the local cache within the specified expiration time.
Example: expires: Tue, 08 Feb 2022 11:35:14 GMT
Vary
Purpose:
Example: vary: Accept-Encoding
Cookie/login header domain
P3p
Purpose: set the cookie for cross-origin access. This can solve the problem of cross-origin access cookie for IFRAME.
Example: p3p: Cp = Cura
Problem description
Recently, due to interest, a small application of the developer's Web, the application page is embedded on the webpage through IFRAME. After opening the application, you need to authorize the application, renren requests the returned authorization data to my backend using the get method.CodeIn the background code analysis, several important parameters are stored in the session. However, in IE, it is normal to use Chrome instead of setting the session. I used fiddler for debu
In IE, cross-origin is used to set cookie cross-origin implementation. I tried n Chinese methods. I checked the information and can implement it by setting the p3p value in the header. It's really good :)For example, to access site B and set a cookie on Site a, you can do this:1. Create a cookies.htm file under B .com.Content:1
The content of setcookies. asp under 2.a.com is:Response. AddHeader "P3P", "CP = CURa ADMa DEVa PSAo PSDo our bus uni pur i
station B to achieve the purpose of writing B-Station cookies.Step one: First set the cookie method under B station (b_setcookie.aspx):HttpCookie cookie = new HttpCookie ("key");Cookies. Value = Key;cookie. Domain = ". B.Com";//the B station Cookie.path = "/" is specified here, and acookie. Expires = DateTime.Now.AddHours (1); RESPONSE.COOKIES.ADD (cookie); Step two: Since the "http://www.b.com/b_setCookie.aspx" />When the above steps are completed, when you access the a_setcookie.aspx of stat
(Brim). The brim extends outwards at the bottom of the model, extending a layer of thin slices. can increase the interface with the printing table, the grip will be increased, reducing the dead side of the situation. The width of the skirt is proposed to 5mm above, the effect will be more obvious.Preview of the Open skirtThe Raft Raft is similar to the skirt, but will poker the bottom of the entire work. The extra expansion of the area can provide more gripping force to prevent dead. However, m
function of the skirt (Brim). The brim extends outwards at the bottom of the model, extending a layer of thin slices. can increase the interface with the printing table, the grip will be increased, reducing the dead side of the situation. The width of the skirt is proposed to 5mm above, the effect will be more obvious. Preview of the Open skirtOpen Board (Raft)Raft is similar to the skirt principle, but will poker the bottom of the entire work. The extra expansion of the area can provide more
Company's products, the use of multi-service allocation of pressure, the middle must be involved in a single point of landing. The general single sign-on is to go to the User Center login, 302 or page callback method, return to the pre-landing page.
Company projects, want to user experience better, using the frame landing, you can consider the IFrame or form submission method. IFrame needs to solve the problem of cross-domain communication, of course, there is a solution. If the form is submi
refers to the change of the contents of the file, using the timestamp UNIX format and returning when there is an error FALSE .For example:
$file="/software/test.txt"; echo"文件最后访问的时间是".date("Y-m-d H:i:s",fileatime($file)).""; echo"文件最后改变的时间是".date("Y-m-d H:i:s",filectime($file)).""; echo"文件最后修改的时间是".date("Y-m-d H:i:s",filemtime($file)).""; ?>
Remote Files
functionremote_filectime($url_file){$headInf = get_headers($url_file,1); //注意第二个参数 return strtotime($headInf['Last-Modified']);
Each page definition allows access to file constants
Define (' Is_access ', true);
/**
************************************************
1. Basic Configuration
************************************************
*/
If no is_access is defined, exit the program
if (!defined (' is_access ')) exit ();
Allow cross-domain access to private data
Header (' p3p:cp= ' NOI CURa ADMa DEVa Taia our DE
information domain name, if it is in 1, 2 domain name, directly set the cookie as the host domain name, for example:
Setcookie ("session_id", session_id (), Time () +3600*24*365*10, "/", ". a.com");
Perhaps you would ask: what if it is in a different domain? Using P3P technology Simple solution, the implementation of the principle, when visiting the site x.com, y.com program trigger y.com file Write SessionID value, SessionID value can be obtained, and then put the Seesion value into the data
How php shares COOKIE cross-origin operations with P3P
127.0.0.1 www.a.com
127.0.0.1 www. B .com
First, create the_setcookie.php file:
// Header ('p3p: CP = "CURa ADMa DEVa PSAo PSDo our bus uni pur int dem sta pre com nav otc noi dsp cor "');
Setcookie ("test", $ _ GET ['id'], time () + 3600, "/", ".a.com ");
?>
Then: create the_getcookie.php file:
Php configuration file setting Sample code
// Each page defines the constants allowed to access the file
Define ('is _ access', true );
/**
**************************************** ********
* **************** 1. basic configuration
**************************************** ********
*/
// Exit the program if IS_ACCESS is not defined
If (! Defined ('is _ access') exit ();
// Allow cross-origin access
not use shared cookies?
Discussion
Reference:
Cookies for different domain names cannot be shared.
However, if you are talking about the same level-1 domain name, you can. Set cookie path to. top-level domain name
What I'm talking about is completely different. some websites have done it and I don't know how to do it.
------ Solution --------------------
Assume that there are domain names www.a.net and www. B .net.
Each domain name has a cookie. php file.
PHP code
header(
cross-domain access to cookies for IFRAMEExample: P3p:cp=cura ADMa DEVa Psao psdo our BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP CORSet-cookieRole: A very important header, used to send cookies to the client browser, each write cookie generates a Set-cookie.For example: set-cookie:sc=4c31523a; path=/; Domain=.acookie.taobao.comEntity header FieldETagFunction: Used in conjunction with If-none-match. (See examples of If-none-match in the section)F
: host:http:// www.guet.edu.cn The default port number 80 is used here, if a port number is specified, it becomes: Host: Specify port numberHTTP Response HeaderAlso use Fiddler to view Response header, click Inspectors tab->response tab-> headers as shownCache header FieldDate effect: The exact time and date when the message was generated. Example: Date:sat, 11:35:14 GMTExpires effect: The browser uses the local cache for the specified expiration time. For example: Expires:tue, 2022 11:35:14 GMT
://www.guet.edu.cnThe default port number 80 is used here, and if a port number is specified, it becomes: Host: Specify port numberHTTP Response HeaderAlso use Fiddler to view Response header, click Inspectors tab->response tab-> headers as shownWe also classify the header according to Fiddler, so that it is clearer and easier to remember. Cache header FieldDateRole: The exact time and date of the message generationExample: Date:sat, 11:35:14 GMTExpiresRole: The browser will use the local cache
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.