一个没有 cookie 的子域
我有一个
包含多个子域的网站,每种语言一个子域:pl.example.com、en.example.cm、fr.example.com。我想在所有子域中保留一个会话,因此我为“.example.com”设置会话 cookie 和 Remember_me cookie。另一方面,所有图像均应在没有 cookie 的情况下提供。是否可以告诉 Apache 不要为该特定子域发送 cookie(pl.example.com、en.example.com、fr.example.com - 共享 cookie、images.example.com - 根本没有 cookie )
此致 一个。
Greetings
I have a website with multiple subdomains, one subdomain per language: pl.example.com, en.example.cm, fr.example.com. I would like to keep one session across all subdomains so I'm setting session cookie and remember_me cookie for ".example.com". On the other hand all images should be served without cookies. Is it possible to tell the Apache to don't send cookies for this one particular subdomain (pl.example.com, en.example.com, fr.example.com - shared cookies, images.example.com - no cookies at all)
Best Regards
A.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在适当的 httpd 配置部分:
或者首先不要尝试设置 cookie。
In the appropriate httpd config section:
Or just don't try to set cookies in the first place.
我不知道您的问题的合格解决方案,但是 - 我会以另一种方式构建结构:
然后您将能够使用
mod_rewrite
重写您的网址pl.yourdomain.com< /code> 到
yourdomain.com/pl/
。我认为这种方法使事情变得容易得多。
I don't know a qualified solution to your question but - I'd build the structure another way:
You would then be able to use
mod_rewrite
to rewrite your urlpl.yourdomain.com
toyourdomain.com/pl/
.I think this approach makes things much easier.