【发布时间】:2011-07-19 17:44:57
【问题描述】:
我有一个通过 Varnish 加载的基本 PHP 页面,其中包含一个 ESI 包含,它回调到服务器以设置 cookie。 cookie 是通过域访问等设置的,但是当通过 ESI 调用时,cookie 永远不会设置。如果您直接访问 ESI 包含路径,则 cookie 设置没有问题。我什至将我的 Varnish 配置设置为从不缓存任何内容,我认为 VCL 可能会杀死 cookie。
这...
<esi:include src="/init.php?<?=http_build_query($_GET); ?>"></esi:include>
...包括这个...
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
setcookie('superman', 'clark kent', 0, '/', '.whatever.com');
?>
我是 Varnish 和 ESI 的新手,所以我开始怀疑这是否是一个已知的限制(无论是 ESI 还是 Varnish 的 ESI 实现),但我在网上找不到任何关于我的问题的讨论。
【问题讨论】:
标签: php cookies varnish edge-side-includes