首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >子域认证

子域认证
EN

Stack Overflow用户
提问于 2010-11-29 02:00:12
回答 1查看 1.2K关注 0票数 1

我正在使用默认的ASP.NET身份验证解决方案。现在我的服务器上有子域(例如。example.com,blog.example.com,forum.example.com.)登录发生在example.com上,并发出身份验证cookie。但是当我去forum.example.com时,我会被重定向到登录。是否有配置设置使登录为*.example.com工作?

值得注意的是,cookies是作为域的"example.com“发布的。因此,我根据一些阅读将其改为".example.com“,现在子域身份验证工作成功了。有人能解释吗?

EN

回答 1

Stack Overflow用户

发布于 2010-11-29 02:17:25

根据RFC 2109的说法,如果您不在域上添加一个点的前缀,那么它是无效的,应该拒绝cookie。来自RFC 2109

Domain=domain可选。域属性指定cookie对其有效的域。显式指定的域必须始终以点开始。

代码语言:javascript
复制
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.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4300329

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档