收藏
回答

原react项目 iframe接入H5机器人,每次链接都会刷新cookies?

问题:

原有项目是 react 项目,使用 iframe 来引入H5机器人。但是发现每次发起链接,都会刷新cookies,导致每次都误认为是新客户的聊天记录。

代码如下

 <div><iframe sandbox="allow-same-origin allow-scripts allow-popups allow-forms" src='https://chatbot.weixin.qq.com/webapp/BiOnTGa1FiCd7Rj0do4gyKKPDqndWo?robotName=%E5%AD%A6%E9%82%A6%E6%8A%80%E6%9C%AF%E5%AE%98%E7%BD%91%E5%AE%A2%E6%9C%8D&openid=abcdafd&nickname=robin' style={{ height: '500px', width: '1000px', position: 'absolute' }} /></div>

报错信息:

This Set-Cookie header didn't specify a "SameSite" attribute and was defaulted to "SameSite=Lax," and was blocked because it came from a cross-site response which was not the response to a top-level navigation. The Set-Cookie had to have been set with" SameSite=None" to enable cross-site usage.

预期:

多次聊天都默认同一个session 的聊天。

回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签