提问人:Srinivas 提问时间:11/15/2023 最后编辑:Srinivas 更新时间:11/15/2023 访问量:25
Axios 也为子域发送 cookie
Axios sending cookies for subdomain as well
问:
我创建了一个应用程序并托管在开发和生产中。这是 url 的样子,.我的服务器发送 cookie 并将 cookie 域设置为 和 。所有 Cookie 都设置为 和 、 。app.hello.com
app.dev.hello.com
hello.com
dev.hello.com
HTTPOnly
Secure: true
Samesite:Lax
我正在使用 axios,并设置为读取 cookie 并将其发送到请求标头中。withCredentials:true
- 当我打开时,只有 cookie 被发送到服务器。
app.hello.com
hello.com
- 当我打开时,所有cookie都有,或者发送到服务器。我需要将其限制为仅.
app.dev.hello.com
hello.com
dev.hello.com
dev.hello.com
我该怎么做?
答: 暂无答案
评论