You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

子域名地理定位权限咨询:将登录服务改为子域名能否实现单次授权?

Will switching login server to a subdomain allow one-time geolocation permission?

Great question! The short answer is yes—moving your login service from login.com to login.site.com (a subdomain of your main site.com) will let users grant geolocation permission just once, and that permission will work across both the main site and the login subdomain. Here's why:

  • Browser permission storage is tied to eTLD+1 (registered domain)
    Browsers group permissions (like geolocation, notifications, or camera access) by the effective top-level domain plus one—essentially your root registered domain. For site.com and login.site.com, their eTLD+1 is site.com, so the browser treats them as part of the same "site group." Any permission granted to one will automatically apply to the other.

  • Protocol and port consistency matters
    Just make sure both site.com and login.site.com use the same protocol (either both HTTPS or both HTTP) and port (default ports like 80 for HTTP or 443 for HTTPS are fine). Browsers include these in their permission checks, so mismatches could break the shared permission behavior.

  • Note for existing users
    If some users already granted permissions to the old login.com domain, they might need to clear their browser's permission cache for that domain to see the shared permission take effect. New users won't run into this issue.

内容的提问来源于stack exchange,提问作者Brombomb

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 11:43:12