I have the JS tracker code that looks something like this:
Despite the "setSessionCookieTimeout" call, the _pk_ses cookie is created with a 30 minute expiration (as per the default). Since this is not a SPA, every page keeps updating the cookie with the 30 minute expiration. However, if I add "setSessionCookieTimeout" to the applyFirst array in piwik.js, then the cookie is created with the 2 hour expiration as desired. Is that a bug, or do I misunderstand the intent of setSessionCookieTimeout and applyFirst?
On a related note, I'm struggling to understand what expiration of _pk_ses actually controls. I changed visit_standard_length to 2 hours in the config.ini.php file and that seems to do what I expect without the JS setSessionCookieTimeout call. Even if I delete the _pk_ses cookie, the original visit is still continued on the next page navigation. In case it matters, I also have trust_visitors_cookies = 1.
Thanks a lot.
Thanks for letting us know, created a PR 👍
Great, thank you! Do you have a sense of what exactly won't work correctly in my setup if visit_standard_length is 2 hours, but the session cookie timeout is 30 minutes?
Good question, I think it would increase the visit count more often and possibly play up a little bit with the "last known referrer" but not sure how much that would actually effect it.