LTI 启动后无法访问站点 cookie

Unable to access site cookie after LTI Launch

我有一个与 canvas 集成的小型 LTI 应用程序,在 LTI 启动后我无法访问 cookie。这在 Safari(总是)和 Chrome(有时)中失败。

我正在强制使用 cookie 的 SameSite=LAX 字段。

我不确定我还应该尝试什么。

Chrome(和其他浏览器)regarding cookies and iframe. 中有许多变化。对于 LTI 1.3 启动,这非常困难,因为您需要在处理 OIDC 流时如何跟踪 cookie 中的启动状态。

变化的基础是现在有一个 'SameSite' cookie 策略,其中 Only cookies set as SameSite=None; Secure will be available in third-party contexts, provided they are being accessed from secure connections. 因此必须将 cookie 标记为 SecureHTTP-Only除了 SameSite=None

同样在 Safari 中,第三方框架必须先请求访问 storage API,然后才能访问 cookie。

Firefox 正在使用分区存储方法,因此框架将正常运行,除非您随后将应用程序作为新的 window 打开,然后 cookie 存储可能会或可能不会跟随,具体取决于已创建新 window。

Cookie Status 是一个很好的资源,可以跟踪第三方 cookie 在不同浏览器中的工作方式以及您应该如何更改才能使其工作。