ASP. NET tip: How to Implement p3p HTTP headers

Source: Internet
Author: User

The Problem
Q: Why "make sure to implement p3p if using iframes "?

 

A: If your application is inside iframe with parent belongs to another domain-cookies will not work for some very common invocations for example IE 6/7 with privacy set to medium. if Cookies don't work-session won't work.

 

Therefore session state turns out useless for your application under Internet Explorer. See-privacy in Internet Explorer 6.

 

This is relevant when domain that hosts IFRAME is different from parent domain. Because of the fact that this is not very common scenario-only a few familiar with the solution.

 

The solution
Solution-need to implement p3p header to tell the browser that cookies for your application inside IFRAME are OK for user privacy.

 

So, ASP. NET implementation may look like the following (Global. asax ):

 

Protected void application_beginrequest (Object sender, eventargs E)
{
//
Httpcontext. Current. response. addheader ("p3p", "cp = \" Cao PSA our \"");
}

 

Related Article

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.