Apache / PHP禁用子域的Cookie? [英] Apache / PHP Disable Cookies for Subdomain?
问题描述
我想按照这些指南来加快我的网页载入速度。
I am trying to follow these guidelines to make my page load quicker.
我创建了一个静态子域来加载静态内容,但它建议我不要在此子域发送Cookie,任何关于我可能如何在Apache / PHP中这样做?
I have created a static subdomain to load static content from, however it is advising me to not have cookies sent on this subdomain, any ideas on how I might be able to do this in Apache/PHP?
我已经搜索过,没有任何东西。
I've searched around and come up with nothing yet.
推荐答案
如果您从未明确设置Cookie,则Cookie不会出现在服务器上。因此,如果您使用第二个域作为图像或CSS文件的存储库,很可能没有设置任何Cookie。
If you never explicitly set a cookie, cookies won't be present on the server. So, if you are using the second domain simply as a repository for images or CSS files, most likely no cookies are ever set.
从注释中更新。 / strong>
Updated from Comments.
如果您看到某个子域的请求Cookie标题,而您不想要Cookie,请清除Cookie,看看服务器是否发送过cookie头中。如果是,您可以启用session.auto_start,或者您有一个设置Cookie的脚本。
If you see a 'Request' cookie header to a subdomain you don't want to have cookies, clear your cookies and see if the server ever sends a cookie header in the Response headers. If it does, it is possible you have session.auto_start enabled, or you have a script that sets cookies.
您可以使用类似Firebug的方法检查请求和响应标头与Google Page Speed。
You can check the Request and Response Headers using something like Firebug with Google Page Speed.
这篇关于Apache / PHP禁用子域的Cookie?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!