不是必须的。前置 "." 是旧规范 RFC 2109 (已作废)的要求。 An explicitly specified domain must always start with a dot. 而当前规范 RFC 6265 说了 Set-Cookie 时,domain 属性的前置 "." 会被忽略 Note that a leading %x2E ("."), if present, is ignored even though that character is not permitted 因此第二种写法是没有问题的
不是必须的。前置 "." 是旧规范 RFC 2109 (已作废)的要求。
而当前规范 RFC 6265 说了 Set-Cookie 时,domain 属性的前置 "." 会被忽略
因此第二种写法是没有问题的