RGPD - cookieLifetime  - write custom code to set a date on which to delete the cookie | Community
Skip to main content
Level 2
December 14, 2021
Solved

RGPD - cookieLifetime  - write custom code to set a date on which to delete the cookie

  • December 14, 2021
  • 2 replies
  • 1221 views

Hello,

 

Currently we use cookieLifetime  variable to set the Adobe cookie limit on our website.

 

Seen with the new rules of RGPD, we fixed the expiry to 13 months to abide by the law.

 

Now we need to add a setting to make the cookies' expiry date not get renewed on every visit.

 

So for example : 

 

Visitor X : 

Visit 1 - 02/01/2022 : Cookie expires in 13 months - expiry date : 02/02/2023

Visit 2 - 12/03/2022 : Cookies already exist - expiry date shouldn't be renewed - cookies still have to expire on 02/02/2023

 

I checked the Adobe documentation, all I found is this:

 

  • 13-month cookie limit. You can override your analytics cookie expiration using the cookieLifetime variable. Experience Cloud cookies including Analytics and ECID extend the cookie expiration date with each visit. To set a static, non-rolling cookie expiration, you can either: (1) write custom code to set a date on which to delete the cookie, or (2) use your CMP to control the date of the cookie reset. cookieLifetime and Experience Cloud Cookies

Source : https://experienceleague.adobe.com/docs/analytics/admin/data-governance/cnil-consent-exemption.html?lang=en

 

 

Has anyone ever done this using the first solution? As I am not able to find more information online.

 

Thank you

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by yuhuisg

Since this is a limitation in AppMeasurement or ECID itself, I don't think there's anything that you can do. You'll have to consult Adobe Client Care to see if they can get engineering to update their code to allow you to specify an expiry that never changes.

2 replies

khurshid
Adobe Employee
Adobe Employee
December 14, 2021

You may set an static expiry date by setting a string integer.

s.cookieLifetime = "86400";

 

See https://experienceleague.adobe.com/docs/analytics/implementation/vars/config-vars/cookielifetime.html?lang=en.

 

prahmeAuthor
Level 2
December 14, 2021

Hello,

 

I think you misunderstood my question.

 

We already assign cookieLifetime to 13 months in a string integer.

 

What I meant in my question is, how do I avoid that the cookie renews 13 months at every visit of the same user?

Thank you

yuhuisg
Community Advisor
yuhuisgCommunity AdvisorAccepted solution
Community Advisor
December 17, 2021

Since this is a limitation in AppMeasurement or ECID itself, I don't think there's anything that you can do. You'll have to consult Adobe Client Care to see if they can get engineering to update their code to allow you to specify an expiry that never changes.