CGI::Simple and P3P headers

gav on 2003-11-19T19:54:04

If you are using CGI::Simple and want to set a P3P header so that cookies on IE6 will work correctly, but you don't want to use a policyref file (you don't need to) you can make this quick fix. Change line 696 from:

push(@header, qq(P3P: policyref="/w3c/p3p.xml", CP="$p3p"));

to

push(@header, qq(P3P: $p3p));

Now you can correctly set a P3P header, eg:

$cgi->header( -P3P => 'CP="NOI DSP COR NID TAIa OUR NOR"' );

I've got no idea what that compact policy means, but it does the trick. The whole concept behind P3P makes no sense to me.


or use mod_headers

autarch on 2003-11-19T20:50:25

I just use Apache's mod_headers to add these to all responses. It's a lot simpler, and since there's no harm in including these for every response, it's simpler than sticking it somewhere in my app.