setcookie 的domain是不是指同一域的子?比如只能domain.com下的,a.domain、b.domain等,而不能domain2.com?

winder 2006-06-20 07:09:08
setcookie 的domain是不是指同一域的子?比如只能domain.com下的,a.domain、b.domain等,而不能domain2.com?
...全文
251 4 打赏 收藏 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
winder 2006-06-21
  • 打赏
  • 举报
回复
setcookie两个域??

在domain1.com/setCookie.php

中setcookie( "name", "value", "domain2.com" )

这样无效的吧,否则,岂不是乱套了?
it_zl 2006-06-21
  • 打赏
  • 举报
回复
如果你需要你可以同时setcookie两个域的
xuzuning 2006-06-21
  • 打赏
  • 举报
回复
对
iasky 2006-06-21
  • 打赏
  • 举报
回复
domain=DOMAIN_NAME
When searching the cookie list for valid cookies, a comparison of the domain attributes of the cookie is made with the Internet domain name of the host from which the URL will be fetched. If there is a tail match, then the cookie will go through path matching to see if it should be sent. "Tail matching" means that domain attribute is matched against the tail of the fully qualified domain name of the host. A domain attribute of "acme.com" would match host names "anvil.acme.com" as well as "shipping.crate.acme.com".
Only hosts within the specified domain can set a cookie for a domain and domains must have at least two (2) or three (3) periods in them to prevent domains of the form: ".com", ".edu", and "va.us". Any domain that fails within one of the seven special top level domains listed below only require two periods. Any other domain requires at least three. The seven special top level domains are: "COM", "EDU", "NET", "ORG", "GOV", "MIL", and "INT".

The default value of domain is the host name of the server which generated the cookie response.


21,889

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧