The below P3P setHeader code is present in my CASresponse jsp but doesn't seem to work,
response.setHeader("P3P","policyref=\"http://sso.mydomain.net/w3c/p3p.xml\",
CP=\"CAO IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");
Am I missing something here? I am not able to get my third party cookies in IE8.
Is policref required in the header? Should i set a p3p policy for my domain?
Since its a CAS request should i set it when all requests come into CAS?? Say i have entryFilter.java should i set the P3P header there?? Or after the cookie gets created.
I am not able to retain the cookies when IE does a 302 redirect to my serviceUrl.
The short answer first :)
you can add the header simply as
but as you need the header on all the resources, better go for the filter
the long answer
I was suffering from the same issue a while back. Probably just like you, I've did my homework and developed a fair understanding of what P3P policy is and how it is meant to be used. What I was referencing at a time are
Official links
http://www.w3.org/P3P/
http://p3ptoolbox.com/guide/
Notable blogs
http://www.marco.org/2007/04/27/p3p-sucks-how-to-get-frame-cookies-unblocked-in-ie6
http://www.techrepublic.com/blog/software-engineer/craft-a-p3p-policy-to-make-ie-behave/
Notable SO questions
Cookie blocked/not saved in IFRAME in Internet Explorer
P3P Policy not working to allow 3rd party cookies in IE
despite all this I was still failing to make it work properly. What I was failing to realize, and what I eventually learned with the help of this amazing book is that, quote
I suspect that this could be your issue as well, the P3P policy I use is almost exactly the same as yours, so you're not getting denied over an invalid policy.
I set my header without a URL to a p3p policy, as said in a techrepublic blog
and this has proven true in my tests. This would mean that you can add the header simply as
However, as you need it in all the response better write a filter something like
and applied a filter to all requests.