Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Including - cq/personalization/components/clientcontext - causing site wide javascript malfunction when browser cookies are DISABLED - CQ5.6

Avatar

Former Community Member

In my project I had to add the default OOTB mBOX component to the sidekick in order for authors to allow creating mboxes across the site. Going through adobe documentation, I found that we have to include cq/personalization/components/clientcontext after start of body tag and cq/cloudserviceconfigs/components/servicecomponents before end of body tag.

All went fine, until a user reported that the whole site is looking weird and everything is out of place. On inspecting we found that  most of the javascript plugins and normal javascript code wasnt executing and that was leading to most things out of place. Then we found that it was happening because of COOKIES Disabled in that user's Firefox.

When we enabled the cookies on that browser, everything looked great as always.

We then DISABLED the cookies again and removed the include of cq/personalization/components/clientcontext from start of body tag. Now even with Disabled cookies the site wide js ran smoothly without any issues. All looked fine after removing the clientcontext include.

 

This brought us to the conclusion that cq/personalization/components/clientcontext include causes ISSUES when Cookies are disabled.

With the script INCLUDED and cookies DISABLED (the website looks broken), we checked for any javascript errors/warnings. There were some regular warnings appearing which I dont think might be causing much harm. There are NO JS ERRORS found in the FF console.

These warnings appear only for kernel.min.js. If we EXCLUDE the component and the run the page and see the console, the same regular warnings appear for almost all js files like jQuery.min.js and many others. So I am assuming these warnings are not much of a concern. But the point that only kernel.min.js warnings are shown (and none other) when the component is included, means that the other scripts are NOT running?? may be?

 

Has anyone experienced the same ever? Any pointers to what we can do make the cq/personalization/components/clientcontext not affect our site wide JS, in case of disabled cookies.

1 Accepted Solution

Avatar

Correct answer by
Level 10

That is because clientcontext.js under cq/personalization/component/clientcontext contains this check for cookie CQ_Analytics.Cookie.read

If you have cookie disabled in browser, it would throw an exceptions which would cause the issue.

View solution in original post

6 Replies

Avatar

Correct answer by
Level 10

That is because clientcontext.js under cq/personalization/component/clientcontext contains this check for cookie CQ_Analytics.Cookie.read

If you have cookie disabled in browser, it would throw an exceptions which would cause the issue.

Avatar

Level 10

I have passed this to the support team to determine if this is a known issue. 

Avatar

Level 1

Hi, 

Is there any solution available?  We encounter the same issue. 

/etc/clientlibs/foundation/shared.js throws this error - Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.

And all the teaser components stop working. 

Avatar

Former Community Member

Hi smacdonald2008,

Thanks a lot for your response and action.

I will wait for your response regarding what the support team has to say about this.

 

Thanks again!

Avatar

Level 1

Does it mean the AEM segmentation and teaser component doesn't support cookie disabled scenario?   Is there anyway to load default campaign when cookie is disabled?  

Avatar

Level 10

please log a support ticket on the same.