This could be an explanation:
If you understand correctly, your script is downloaded from the site www.example.com, but used by sites in other domains, say, www.someotherdomain.com.
If you create a cookie and try to use this cookie in a request from www.someotherdomain.com to www.example.com, the browser will consider it a third-party cookie. Cookies are a third-party cookie because the domain you are located on (www.someotherdomain.com) is different from the domain to which the request is sent (www.example.com).
Several browsers block third-party cookies, so cookies are not included in the request for www.example.com.
, cookie, .