简体   繁体   English

子域之间的Cookie共享

[英]Cookie share between sub domains

I have implemented cookie sharing between sub domains of my sites, but the issue is that not all cookies are shared. 我已经实现了站点子域之间的cookie共享,但是问题是并非所有cookie都是共享的。 why this happens. 为什么会这样。 Is there any cookie configuration that cookie becomes specific to site and could not be shared? 是否有任何cookie配置,使得cookie特定于站点并且无法共享?

  • You should be able to share the cookie by using a domain in format of ".domain.com" (dot and root domain) and your "path=/" always. 您应该能够通过使用“ .domain.com”(点域和根域)格式的域以及始终使用“ path = /”来共享Cookie。
  • Double check that whenever you generate a cookie, you follow this rule. 仔细检查,只要您生成Cookie,就遵循此规则。

Open inspector in Chrome -> switch to Application -> Cookies and see your cookies with all parameters. 在Chrome中打开检查器->切换至应用程序-> Cookies,然后查看包含所有参数的Cookies。 Make sure path, domain and http properties are correct. 确保路径,域和http属性正确。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM