# 添加路径到Cookie

**URL:** <https://meta.discourse.org/t/add-path-to-cookie/40218>\
**Category:** Development\
**Created:** [2016年二月26日 09:42 UTC](https://meta.discourse.org/t/add-path-to-cookie/40218 "2016-02-26T09:42:05Z")\
**Posts on this page:** 1\
**Showing post:** 45

<div class="post-metadata">

**Author:** ![Dylan-Brotherston](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dylan-brotherston/32/488781_2.png) [@Dylan-Brotherston](https://meta.discourse.org/u/Dylan-Brotherston)\
**Post date:** [2025年五月25日 16:50 UTC](https://meta.discourse.org/t/add-path-to-cookie/40218/45 "2025-05-25T16:50:42Z")

</div>

7 年过去了，\_t cookie 仍未设置 Path  
 ![The image appears to show a screenshot of a blue screen with partially visible text including the date "Thu, 24 Jul 2025" and a timestamp. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/e/1/7/e17fb8739b485de8561cf6cb0529b27fa5df784a.png)  
运行版本 v3.4.2

我托管了两个服务器，每个服务器运行约 15 个 discourse 实例，使用子目录。未为 \_t cookie 设置 Path 是一个相当大的痛点。

`DISCOURSE_TOKEN_COOKIE` 也未在任何地方记录。

在 Google 上搜索只有 3 个结果：此帖子、一个指向定义该变量的 GitHub 的代码链接以及一个指向名为 `isharkfly` 的 404 链接。

我花了 6 个多月才找到这个帖子。

---

_[View the full topic](https://meta.discourse.org/t/add-path-to-cookie/40218)._
