【问题标题】:Cypress Error: Failed to parse or set cookie named赛普拉斯错误:无法解析或设置名为的 cookie
【发布时间】:2019-06-25 18:17:12
【问题描述】:

从 Cypress 版本 3.1.0 升级到 3.3.1 并开始在每次运行测试时看到以下错误。

cy.visit() 尝试加载失败

我们在网络级别收到此错误:

错误:无法解析或设置名为“cookie-name”的 cookie。

堆栈跟踪如下:

铬 75:

未定义

电子 61:

错误:设置 cookie 失败

有谁知道从 3.1.0 版开始有哪些变化可能导致此问题,除了恢复之外还有其他解决方法吗?

Edit: Zach correctly deduced the problem stemming from the server trying to set a secure cookie on a site that is not secure. This presents a problem since the server cannot be changed and securing the domain in question is not really an option. Aside from being perpetually stuck on version 3.1.0 any ideas for workarounds or reverting the change would be appreciated.

【问题讨论】:

  • 你能分享设置cookie的代码吗?
  • cookie是服务器设置的,所以没有这方面的代码分享。
  • 是的,那个代码。 :) 我只在您尝试在非 HTTPS 来源上设置 secure cookie 时看到此错误,是这样吗?
  • 抱歉我误解了。您是正确的,因为 cookie 是安全的,而域不是。 “设置 Cookie:键=值;路径=/;安全;HttpOnly”。感谢您提供进一步调查的途径。

标签: cypress


【解决方案1】:

事实证明,Github 中已经存在一个未解决的问题。 https://github.com/cypress-io/cypress/issues/3525

在 3.1.1 版中,他们修复了一些关于安全 cookie 过期的问题,这似乎是一个副作用。

【讨论】:

    猜你喜欢
    • 2021-11-26
    • 2020-12-23
    • 2021-07-05
    • 1970-01-01
    • 2021-08-08
    • 1970-01-01
    • 1970-01-01
    • 2021-07-07
    • 1970-01-01
    相关资源
    最近更新 更多