Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Set-Cookie header not coming through response header


Level 7

When I have an ajax call to an aem sling servlet. 


Sling servlet setting a cookie header "Set-Cookie", which is coming through response headers on Author, Publisher.

But on Cloud Front URL, this "Set-Cookie" not coming through response headers.


Could some one help me, Do I need to mention what headers allowed from Cloud Front to front end client?




6 Replies


Level 6

That should work without any settings to AEM.

This could help troubleshoot.

Does the cookie have the path parameter to it? That could be an easy miss.

Also, is the cookie trying to set secure flag on a non-secure http host?


The set-cookie code that you are forming in the servlet, is the t possible to may be set it using a different method, let's say, set it in JS in browser console.






Level 7

yes path set to "/" and no secure flag as this cookie need to be read by analytics.


Community Advisor

In AEM dispatcher you can configure the farm.any, which should include the set-cookie flag




Level 7

I will try this @BrianKasingli thanks! but documentation says "defines a list of HTTP headers that Dispatcher passes from the client HTTP request to the renderer (AEM instance)" 


The 'Set-Cookie' headers are response headers from aem publish instance to client browser.


Level 7

@BrianKasingli @Preetpal_Bindra issue happening at cloud front level , verified direct dispatcher url and is sending all custom headers. It is cloud front , which is not sending headers from dispatcher to browser. any help on this ?



@sreenu539 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni