SDI Cookie is not being saved | Community
Skip to main content
Sady_Rifat
Community Advisor
Community Advisor
April 24, 2024

SDI Cookie is not being saved

  • April 24, 2024
  • 2 replies
  • 775 views

I was trying to add Sling Dynamic Include (SDI) in a component that is set cookie in the browser.
Before SDI Enable:

+ The Dispatcher cache was disabled.

+ Each time the page is refreshed, the component Model class is rendered and set cookie in the browser.

After Enable SDI:
+ Dispatcher cache is enabled and the page is being cached.

+ Also enabled the SDI so the component is not being cached. (I checked the corresponding HTML code from the dispatcher cache it's working. The component is not being cached.) Also, I checked the server log, the Model log is also written in the publish server.

+ But the cookie is not set in the browser.

 

Why this happened? Or what could be the possible solution or mistake?

 

My OSGI Config

{
"include-filter.config.enabled":true,
"include-filter.config.path":"/content",
"include-filter.config.resource-types":[
"my-project/components/content/meta-navigation",
"my-project/components/content/lms-survey"
],
"include-filter.config.include-type":"SSI",
"include-filter.config.add_comment":true,
"include-filter.config.selector":"nocache",
"include-filter.config.required_header":"Server-Agent=Communique-Dispatcher",
"include-filter.config.appendSuffix": true
}
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
April 24, 2024

Hi, 

Are you testing with a CDN on top of your dispatcher? Keep in mind that cookies are set via a header, so there may be a chance that the CDN or even the browser is caching the header, and thus the cookie is not being recreated.

Esteban Bustamante
Sady_Rifat
Community Advisor
Community Advisor
April 25, 2024

Hello @estebanbustamante ,

Actually, This happened on with my local dispatcher also.
After debugging local, the code is executed but the cookie is not set.

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
April 25, 2024

Ok if you are testing locally what may be happening is that your cookie is marked as "secure" and if you don't haver your local dispatcher running over HTTPS this won't be set. Can you double-check that?

Esteban Bustamante
kautuk_sahni
Community Manager
Community Manager
July 16, 2024

@sady_rifat Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Kautuk Sahni