如何在 Openacs 中添加 HTTP 标头字段?

发布于 2024-10-06 10:34:28 字数 253 浏览 0 评论 0原文

我需要在我网站的某个部分的响应中添加一个 HTTP 标头字段,正在 IFRAME 中查看包实例(我的部分),我想声明一个 p3p 字段以便能够在 IE 6 中存储 cockies /7/8(登录效果不好),我知道如何在 PHP 中做到这一点并且非常简单:

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

但我没有找到如何在 TCL/openacs 中做到这一点,感谢您的帮助。

I need to add a HTTP header field in the responses of a section of my site, the package instace (my section) 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 have an idea of 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

聚集的泪 2024-10-13 10:34:28

根据Jim Lynch的回复当您在其他地方问这个问题时,您只需添加它是为页面生成的标题集。
我猜想这样的事情可能是最简单的(假设您不想对标头的内容进行硬编码;如果您这样做,您可以简化一点):

set cpflags "CAO PSA OUR"
ns_set cput [ns_conn outputheaders] "P3P" "CP=\"$cpflags\""

要理解它,您需要阅读 ns_connns_set 来自 AOLserver 文档,以及 set 来自标准 Tcl 文档。

Based on Jim Lynch's response when you asked this question elsewhere, you just need to add it to the set of headers being produced for the page.
I'd guess that something like this is probably easiest (assuming you don't want to hard-code the contents of the header; if you did, you could simplify a little):

set cpflags "CAO PSA OUR"
ns_set cput [ns_conn outputheaders] "P3P" "CP=\"$cpflags\""

To understand it, you need to read about ns_conn and ns_set from the AOLserver docs, as well as set from the standard Tcl documentation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文