Keep in mind that doing so does change pretty little* as obviously users can change the cookie expiration by simply editing the cookie.
* the only thing I can think of that this prevents is that a frontend developer can’t accidentally call these functions thinking they do something else.
Hello, sadly that way to disable the function didn’t work, but we could achieve something similar by using the plugin https://plugins.matomo.org/JsTrackerCustom and writing this into it:
_paq.push([“setVisitorCookieTimeout”, “15552000”]);
Seems that this override any call to the function from outside matomo.js so we are safe like this.