例如,当我在我的角度组件中嵌入 youtube 视频时:
<iframe width="560" height="315" src="https://www.youtube.com/embed/w3jLJU7DT5E"></iframe></div>
我将在开发者控制台的应用程序/存储/Cookies 中获得两个条目:
一个是我的存储空间,localhost
另一个是 iframe 网站的存储空间。
使用ngx-cookie-service我尝试将 cookie 设置到 youtube 部分,如下所示:
this.cookieService.set('cookie1', 'cookie1-value', null, null, 'https://youtube.com');
通过设置 only name
,value
并且domain
since.set
定义如下:set( name: string, value: string, expires?: number | Date, path?: string, domain?: string, secure?: boolean, sameSite?: 'Lax' | 'Strict' | 'None' ): void;
但它将它设置为我的https://localhost:4200
.
是否可以将其设置为https://youtube.com
部分?