Today READ on the Nuggets hu (ya) yu students wrote an article “Cookie SameSite attributes”, write very good.

I would like to add something to the following paragraph.

The judgment of “same-site” in cookies is relatively loose: as long as the eTLD+1 of two urls is the same, protocol and port need not be considered. ETLD indicates a valid top-level domain name registered in the Public Suffix List maintained by Mozilla, for example,.com,.co. UK, and.github. IO. ETLD +1 indicates a valid top-level domain name + a second-level domain name, such as Taobao.com.

For a few examples, www.taobao.com and www.baidu.com are cross-stations, www.a.taobao.com and www.b.taobao.com are co-stations, and A. github. IO and B. github.

It is misleading to call.com,.co.uk and.github. IO “top-level domains”. Instead,.com is the first level domain,.co.uk and.github.

The “common suffix” is an important factor in determining whether two domain names are the same address. A. github. IO and b.github. IO are cross-sites. — because lot. IO suffix list in public, but not in the public taobao.com suffix list (see here for complete public suffix list: publicsuffix.org/list/public…).

And what is a Site? The combination of a common suffix and the name that precedes it.

In other words, Taobao.com is actually a combination of “name (taobao) + common suffix (.com)”. It refers to a website, and A.taobao.com and B.taobao.com are the sub-domain names under this website, which belong to the same website. IO is not the subdomain name of github. IO itself is a common suffix, so when combined with “A”, it is a website, so it is cross-site relationship with b. Github.

** Update: 2020/04/23**

Whether the two addresses are “the same site” also takes into account the protocol used, i.e. :

Same site = root domain name (for example, taobao.com) + protocol (for example, https:// or http://)

For example: the following two addresses, because of different protocols, are not the same site.

# This is not the same site
http://taobao.com
https://taobao.com
Copy the code

(End of text)


Advertising time (long term)

I have a good friend who owns a cattery, and I’m here to promote it for her. Now the cattery is full of Muppets. If you are also a cat lover and have the need, scan her FREE fish QR code. It doesn’t matter if you don’t buy it. You can just look at it.

(after)