Cross-domain carrying problem of cookie

currently I have an interface with the address a.com and the page requests b.com . Using CORS to cross-domain, the data is fine and can be returned normally, but how to pass cookie under a.com to b.com ? The request is using fetch , and credentials: "include" has been set, but it still has no effect. The header Cookie is not added to the browser request at all!

how to solve this cross-domain cookie delivery problem? Are there any great gods who have the experience to guide them?

Mar.03,2021

the conclusion is no, refer to an article and a question to discuss

This won't work if third-party cookies are disabled (automatic for some browser situations)

Cross-Domain Cookies


The

server needs to add the header Access-Control-Allow-Credentials: true , and specify the specific allowed domain names such as Access-Control-Allow-Origin: http://a.com.

js you need to add new XMLHttpRequest (). WithCredentials = true to the XMLHttpRequest object.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3194b-2bd9d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3194b-2bd9d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?