Highlighted

Cookie is not getting created through dispatcher

Avatar

Avatar

Dinu_Arya

Avatar

Dinu_Arya

Dinu_Arya

08-01-2018

Hi Team,

I have to create a cookie based the page which is opened. It is getting created in publish instance. But when I accessed the same page through dispatcher, the cookie is not getting created. I have seen this thread - CQ dispatcher - Cookie issue . As per this we shouldn't cache pages, but my pages should cached.

Is there any way to create cookie through dispatcher by allowing the respective cookie names using any of the dispatcher configuration rules?

I'm using AEM 6.2.

Please help me in this. If there is no configuration from dispatcher end, I will follow the second solution given by Jorg.CQ dispatcher - Cookie issue​@

Thanks,

AryA.

Replies

Highlighted

Avatar

Avatar

smacdonald2008

Total Posts

(val/1000)?string[".0"]}K

Likes

(val/1000)?string[".0"]}K

Correct Answer

(val/1000)?string[".0"]}K

Avatar

smacdonald2008

Total Posts

(val/1000)?string[".0"]}K

Likes

(val/1000)?string[".0"]}K

Correct Answer

(val/1000)?string[".0"]}K
smacdonald2008

08-01-2018

See this thread where Joerg talked about this subject -- CQ dispatcher - Cookie issue

Highlighted

Avatar

Avatar

edubey

Total Posts

(val/1000)?string[".0"]}K

Likes

264

Correct Answer

392

Avatar

edubey

Total Posts

(val/1000)?string[".0"]}K

Likes

264

Correct Answer

392
edubey

08-01-2018

What Jörg mentioned is correct. Page gets cached but since cookie is getting created dynamically. You have to follow either of the shared two solution by him to make it work.

Highlighted

Avatar

Avatar

jamesm77050123

Avatar

jamesm77050123

jamesm77050123

03-10-2018

I have the exact same problem for cookie functionality I'm working on. I can't delete the cache so I can only use the second solution

  • You create the cookie in a more lightweight call (e.g on an AJAX call), which then creates the cookie.


Is this on a front end level using javascript?

Highlighted

Avatar

Avatar

Dinu_Arya

Avatar

Dinu_Arya

Dinu_Arya

11-10-2018

You can create cookie either from front end using document.cookie or in the back-end using servlet