ECID cookieLifetime is not getting reflected
Hi Everyone,
I have the below problem statement as part of the custom implementation of the OPT-IN feature.
We want to send tags in both cases (Customer opts-in OR doesn't opt-In) with a difference that mandatory tags will be sent in case of customer has opted-In.
Now, the customer has multiple applications on the website (running on .net and AEM SITES). So, the customer wants to have one visitor across the website - while navigating to multiple applications of the website. To implement that, when the customer is not opted-In, we want to set the ECID cookies lifetime to "None" and hence no visitorID is created.
To implement this, we have tried with custom code to set the cookie Lifetime - but, it doesn't work.
So, we created a dataElement, which returns a value as "Default" OR "None" based on the conditions of Opt-In. This works fine and the ECID cookies(AMCV and AMCVS) are not created - everything works OK except for one case.
Exception case: When customer visits the site for 1st time - the cookie banner is shown and dataElement returns "None" as cookie lifetime for ECID. Now, the customer opts_In for cookies - the dataElement value gets updated. But, the ECID cookies are not created. When I refresh the page OR navigate to other pages, it creates ECID cookies (AMCV and AMCVS).
Is there any solution recommendation to handle this specific case? Please suggest!
Thanks for looking into my query!

