我正在尝试按照官方文档 http://etherpad.org/doc/v1.2.7/ 的示例 1 将 etherpad-lite 集成到 CMS Plone 中
Portal places the cookie "sessionID" with the given value on the client and creates an iframe including the pad.
除了 cookie 之外,一切都很顺利。阅读文档的最佳实践似乎是使 etherpad-lite 在特定路径下的同一域中。这就是我使用/pad/路径所做的。
如果没有创建 session ,我会在 Plone 端创建,添加一个 cookie,然后重定向到同一页面,以确保 cookie 在浏览器中。
结果,我的 cookie 被添加到主页的请求中,但没有添加到 iframe 请求中。
这是主页和 iframe 的 google chrome 控制台网络选项卡:
http://toutpt.makina-corpus.org/en/images/cookie-in-iframe/
setCookie对应的代码位于https://github.com/toutpt/collective.etherpad/blob/master/collective/etherpad/archetypes.py#L100
最佳答案
对于后代,这里是 the answer来自@AskoSoukka在上面的评论中确定并“接受”:
How does the actual cookie stored in you browser look like? Probably, you need to explicitly specify path="/" in setCookie kwargs to make it work for the whole domain.
关于cookies - 如何在同一域上为 iframe 设置 cookie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14836834/