是否可以使用 TypoScript 获取 $_COOKIE?
在 TypoScript 中,可以获取环境变量 HTTP_COOKIE_VARS (已弃用) ):
10 = TEXT
10.data = global : HTTP_COOKIE_VARS | some_cookie
我得到了这个来自文档。
但在我的服务器(PHP 5.3)上这个变量是空的!我想这是因为这个环境变量已被弃用。现在,如果不使用扩展、用户功能或用户条件,我就没有选择了。
也许你有一个想法!提前致谢。
In TypoScript exists the possibility to get the environment variable HTTP_COOKIE_VARS (which is deprecated):
10 = TEXT
10.data = global : HTTP_COOKIE_VARS | some_cookie
I got this from the documentation.
But on my server (PHP 5.3) this variable is empty! I suppose this is because this environment variable is deprecated. Now I am running out of options, without using an extension, user function or user condition.
Maybe you have an idea! Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这应该可以完成工作(至少对于 TYPO3 4.5 和 PHP 5.3.8):
this should do the job (at least with TYPO3 4.5 and PHP 5.3.8):
不幸的是,
$_COOKIE
变量没有内置功能。但是,您可以编写一个实现 tslib_content_getDataHook 接口的钩子并通过以下方式注册它
Unfortunately, there is no built-in functionality for the
$_COOKIE
variable.You can however write a hook which implements the
tslib_content_getDataHook
interface and register it via