我正在使用默认的ASP.NET身份验证解决方案。现在我的服务器上有子域(例如。example.com,blog.example.com,forum.example.com.)登录发生在example.com上,并发出身份验证cookie。但是当我去forum.example.com时,我会被重定向到登录。是否有配置设置使登录为*.example.com工作?
值得注意的是,cookies是作为域的"example.com“发布的。因此,我根据一些阅读将其改为".example.com“,现在子域身份验证工作成功了。有人能解释吗?
发布于 2010-11-29 02:17:25
根据RFC 2109的说法,如果您不在域上添加一个点的前缀,那么它是无效的,应该拒绝cookie。来自RFC 2109
Domain=domain可选。域属性指定cookie对其有效的域。显式指定的域必须始终以点开始。
4.3.2 Rejecting Cookies
To prevent possible security or privacy violations, a user agent
rejects a cookie (shall not store its information) if any of the
following is true:
* The value for the Path attribute is not a prefix of the request-
URI.
* The value for the Domain attribute contains no embedded dots or
does not start with a dot.https://stackoverflow.com/questions/4300329
复制相似问题