7

I'm trying to make integration of etherpad-lite in the CMS Plone, following Example 1 of the official documentation http://etherpad.org/doc/v1.2.7/

Portal places the cookie "sessionID" with the given value on the client and creates an iframe including the pad.

Everythings goes well except for the cookie. Reading documentation the best pratice seems to make etherpad-lite in the same domain under a specific path. This is what I have done using /pad/ path.

Plone side if no session has been created, I created on, I add a cookie and then I'm doing a redirect to the same page to be sure the cookie is in the browser.

As a results my cookie is added to the request of the main page but not ob the iframe request.

Here is the google chrome console network tab for the main page and the iframe:

http://toutpt.makina-corpus.org/en/images/cookie-in-iframe/

The code corresponding to the setCookie is at https://github.com/toutpt/collective.etherpad/blob/master/collective/etherpad/archetypes.py#L100

Joel Lord
  • 2,175
  • 1
  • 18
  • 25
toutpt
  • 5,145
  • 5
  • 38
  • 45
  • 1
    Do you look at http://stackoverflow.com/questions/2117248/setting-cookie-in-iframe-different-domain ? – Jihaisse Feb 12 '13 at 16:28
  • 1
    this is why I have specified my iframe is on the same domain. I think it is a different use case. – toutpt Feb 12 '13 at 16:32
  • 4
    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. – Asko Soukka Feb 12 '13 at 16:33
  • 2
    @AskoSoukka it seems to be the good answer. I have added the path option and now it is added in the iframe request. – toutpt Feb 12 '13 at 16:51
  • 1
    Note that there is nothing Plone-specific about your question. :-) – Martijn Pieters Feb 12 '13 at 16:54
  • @MartijnPieters always here ! The way to set the cookie is specific to plone, because I put a link to a PLone addon I have added the plone tag. I should not use the tag Plone ? – toutpt Feb 13 '13 at 08:12
  • @toutpt: No need to remove it now; it was theoretically possible that you didn't know how to set the path in your cookie in Plone. :-) (in which case it could be a dupe, there is a question on Plone and cookie setting here on SO already :-)). – Martijn Pieters Feb 13 '13 at 10:25
  • I think @AskoSoukka should create the answer to close the question, right? – marcosfromero Dec 05 '13 at 18:28

1 Answers1

3

For posterity, here's the answer from @AskoSoukka identified and "accepted" in the comments above:

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.

Community
  • 1
  • 1
user456584
  • 86,427
  • 15
  • 75
  • 107