Forum OpenACS Development: How to add HTTP header field (p3p)?

Collapse
Posted by Javier Toledo on
I need to add a HTTP header field in the response of a package of my page, the package instace is being viewed in a IFRAME and I want to declare a p3p field in order to be able to store cockies in IE 6/7/8 (login doesn't work well), I know how to do it in PHP and is quite simple:

?php
header('P3P: CP="CAO PSA OUR"');
?

but I didn't found how to do it in TCL/openacs, thanks for the help.

Collapse
Posted by Jim Lynch on
aolserver keeps track of the headers to send out to the browser. If you want to add a header, you would add it to the "ns_set" data structure (which is like a hash) which is associated with the returning headers.

So in your tcl script associated with the page, you can add content or headers in any order, any mix. Once the page is output, the saved output and the headers go out in the correct order.

For details, see the aolserver tcl api: you will need to get the ns_set that has the headers and then add your header to it.