一个没有 cookie 的子域

发布于 2024-09-26 21:46:24 字数 316 浏览 1 评论 0原文

我有一个

包含多个子域的网站,每种语言一个子域: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 技术交流群。

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

发布评论

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

评论(2

迷你仙 2024-10-03 21:46:24

在适当的 httpd 配置部分:

Header unset Set-Cookie

或者首先不要尝试设置 cookie。

In the appropriate httpd config section:

Header unset Set-Cookie

Or just don't try to set cookies in the first place.

薄情伤 2024-10-03 21:46:24

我不知道您的问题的合格解决方案,但是 - 我会以另一种方式构建结构:

- yourdomain.com
  - /pl
  - /en
  - /fr
  - /images

然后您将能够使用 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:

- yourdomain.com
  - /pl
  - /en
  - /fr
  - /images

You would then be able to use mod_rewrite to rewrite your url pl.yourdomain.com to yourdomain.com/pl/.

I think this approach makes things much easier.

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