Session/cookie failure solution of cross-domain invocation for IE under IFRAME

Source: Internet
Author: User

In frameset, where the frame is from a third party site (different IP or different domain name), then by default IE will automatically disable the cookies of these sites, that is, when a URL is requested in the HTTP header does not send their cookies, Includes a cookie for the session. Note that the cookies that these sites set in the response are still sent to the browser.

When the user browses the a.php, the A.com writes to the first party cookie, and its embedded iframe points to b.php. At this point, the B.Com write to the Third-party cookies, so it is ie when the door outside. So, every time a user submits a cookie, it hangs up. Because no real server can be transmitted.

Cause analysis

Ie6/ie7 supported P3P (Platform for privacy Preferences Project (P3P) specification) protocol to prevent third parties from having no privacy security statement by default

Solution.

PHP's Program

Can be written directly in the B Web site

The code is as follows Copy Code
<?php
Header (' p3p:cp= "cura ADMa DEVa Psao psdo our bus UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR" ")
?>

So you can accept a third party cookie.

A simple C # application

  code is as follows copy code

if ( Request.Browser.Browser.ToUpper (). Contains ("IE"))                

Response.Headers.Add ("P3P", "Cp=cao PSA our");

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.