You said that you "re-wrote the plugin a bit"? Could you provide details, what did you change? What does your code look like? It sounds like maybe what you changed could have caused the issue....
Adobe's plugin codes are really gross to read through (they aren't optimized for human eyes). It would be really easy to miss some of the manipulations that could result in the wrong expiry.
The last version of this code was released over a year ago.. it's hard to imagine that such a large bug would go unfound for so long (but not impossible).
If you can help provide context around what changes you made, that would be a starting point....
sorry, I did not explain my approach very well, so let my try again.
1. I have this issue with a client who actually uses the "out of the box" plugin (without any changes to code) via Adobe Launch. There I found the issue.
To reproduce it, I set up the following on a test website:
1. Installing App Measurement and instantiate it. (as written in the documentation)
When trying it out I get an error that "this.c_r(..) is not defined (since its part of the app measurement .. I changed it to s.c_r(..)). -> Note: I only did that in my test implementation to get it running, for the client everything is standard via Launch.
This change does not impact the cookie-Max Age.
2. I called new Date().toUTCString() just to get the current time:
3. Now I call:
getValOnce("Just a value to get","cookieName",10,"m");
This should get my a cookie, which is valid for 10 minutes.
What I get is a cookie that is valid for more than a month. (September 28th, 2022)
And if I look at the code it makes sense, since here I calculate 60000 ms * d (which is for "m" also 60000)
Do I overlook something very basic here?
Is my test implementation so wrong? Or is it really a bug?
I hope that helps to understand my problem better 🙂
It does thanks... that is very strange then.. also, in Launch, it actually does create an "appMeasurment" file (you just don't edit it directly like the old way - but looks like it might be missing some stuff based on that error)... it does seem like there may be a bug (or 2... or 3) in the plugin... which isn't good.
This might require the engineering team (which means opening a ticket and waiting for someone to debug)....
OR making your own version of the code.... something far more readable....
Basically, it looks like this function just returns a value within a specified time if it doesn't match the last sent version... it shouldn't be hard to make a similar function.
In pseudo "code"
If you try and debug and modify the existing, if someone else is working on the code, they may not know what you have changed.... If you write your own, it should be obvious (and I would suggest adding a comment specifying why you aren't using the standard plugin 😛 )
That said, even if you do your own solution, I would still pursue the client care ticket.. if there is a bug (and it really looks like there a few happening there) they should look at that and make sure no one else has issues....
I would, but since I don't use that plugin, I have no place where they can see the issues in action....
thanks for you comment.
I actually already wrote an adapted version of it, that works now and since I either way can't use the version of Adobe (which will get fixed soon maybe) for the new WebSDK implementation, since it is connected with the App Measurement, I will go with my own version.
Will you create a (global) client care ticket or is it something that I have to do with my "clients specific client care"?
I don't work for Adobe (I'm just another user like you).. so I think that because you have actual observations, it would best come from you.