@cmbuckleyの回答が全体像を示しているかどうかはわかりません。私が読んだのは:
Cookie の属性が特に指定しない限り、Cookie は元のサーバーにのみ返され (たとえば、サブドメインには返されません)、現在のセッションの終了時に期限切れになります (ユーザー エージェントによって定義されます)。ユーザー エージェントは認識されない Cookie を無視します。
RFC6265
また
8.6. Weak Integrity
Cookies do not provide integrity guarantees for sibling domains (and
their subdomains). For example, consider foo.example.com and
bar.example.com. The foo.example.com server can set a cookie with a
Domain attribute of "example.com" (possibly overwriting an existing
"example.com" cookie set by bar.example.com), and the user agent will
include that cookie in HTTP requests to bar.example.com. In the
worst case, bar.example.com will be unable to distinguish this cookie
from a cookie it set itself. The foo.example.com server might be
able to leverage this ability to mount an attack against
bar.example.com.
つまり、サブドメイン/ドメインによる Cookie の読み取りを保護できますが、他のドメインへの Cookie の書き込みを防止することはできません。そのため、誰かが同じブラウザーでアクセスした別のサブドメインを制御して、サイトの Cookie を書き換える可能性があります。これは大きな問題ではないかもしれません。
@cmbuckley が提供する素晴らしい Cookie テスト サイト。上にスクロールして賛成する価値があります/: