After finding myself having to acknowledge cookie consent quite often on sites that I frequently visit, I became curious and started to experiment a little with client side javascript. This revealed that any attempt to create a cookie using client side javascript with an expiry date/time longer than seven days in the future hits a barrier. The calls to document.cookie() complete successfully, but any attempt to use “expires=” or “max-age=” with a date beyond seven days from now results in a seven day expiry. Is this a known limitation, a javascript bug, or caused by something else?
I have seen this in Brave, both on my Windows machine and on my IPad, and the same thing happens with Opera too. I know my Windows (7) is outdated, but this started to happen long before the outdated version warning was a thing. My IPad runs the latest IPad OS and the latest Brave version, so it must be something else at play here.
Apparently there was a change in chrome related to expires/max-age, so perhaps that might have something to do with it? (but seven is a lot less than 400, so maybe not)
EDIT: Just for fun I installed Edge on Win 7 - lo and behold, in Edge, the cookie expiry beyond seven days works as expected!
EDIT 2: Just tried Google Chrome on Win 7, and cookie expiry beyond seven days works fine there too.