可以在“一些”子域之间共享Cookie? [英] It's possible to share a cookie between 'some' subdomains?

查看:117
本文介绍了可以在“一些”子域之间共享Cookie?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读一些关于网络性能的帖子,其中一个要点是

提供来自无Cookie域的静态内容,我的问题是:

I've been reading some posts about web performance, one of the points is to
serve static content from a cookie-free domain, my question is:

我可以在两者之间共享Cookie,我们假设example.com和www.example.com,但不包括static1.example.com,static2.example.com等?

Can I share cookies between, let's say example.com and www.example.com, while excluding static1.example.com, static2.example.com, etc?

还是我需要设置不同的顶级域名?

Or do I need to set a different top level domain?

我知道(或者我认为)我可以设置cookie的域名为 .example.com,但

如果我错了,请纠正我在这所有子域中共享cookie。

I know (or I think) that I could set the domain of the cookie to '.example.com', but
correct me if I'm wrong this shares the cookies across all sub-domains.

推荐答案

您的假设是正确的: - )

Your assumptions are correct :-)

这篇关于可以在“一些”子域之间共享Cookie?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆