我刚刚将网站从一台主机切换到另一台主机,由于某种原因,我们在尝试访问第三方 API 时遇到以下多个错误
Access to XMLHttpRequest at 'https://externalwebsite.com/api/' from origin 'https://www.mainwebsite.com.au' has been blocked by CORS policy: Request header field x-xsrf-token is not allowed by Access-Control-Allow-Headers in preflight response.
.htaccess 文件具有允许这些连接的 CORS 策略:
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
我可以看到旧主机设置了以下 cookie,当我在系统上删除它们时,它允许网站正常工作:
XSRF-TOKEN
1551054855|ZxDIR_16hNnw
.www.mainwebsite.com
hs
1333923782
.www.mainwebsite.com
svSession
253f275579e7747b6495ca6ff45ba024da3bd3b36906f5ac14b709de48792403faf1d3bbff2205d92d2e9a8de90d4b101e60994d53964e647acf411e4f798bcd4c6094311de4bdfbf81f1c6cdfaa3e9de1f5fc736f232b0c584f30f1f7d232d9
.www.mainwebsite.com
我如何包含一些 PHP 或 Javascript 来为加载网站的任何人清除这些 cookie,以便为过去访问过该网站的人正常加载?