cookie_expire for third_party_cookies


#1

Hi,

I added cookie_expire = 604800 in the [Tracker]-part from my config.inc.php…

I guess it doesn’t work for the third-party-cookies (_p_id)?

Is there any suggestion how to expire t-p-cookies?

Cheers
Schorsch


(vipsoft) #2

“piwik_visitor” is the name of the third party cookie, and cookie_expire is used for third party cookies.

If you’re referring to the cookie named “_pk_id.x.yyy”, then that’s a first party cookie, and you would use setVisitorCookieTimeout() in your JavaScript tracking code to change the value.


(maze) #3

Today I tested to change the timeout for the Visitor Cookie. Like in the documentation I added the set-function setVisitorCookieTimeout() to the tracker (1st party cookie). But it is still the default - 2 years. For testing I deleted my cookies first. What can I do?

Changing the auth_cookie via config.ini.php worked.


(vipsoft) #4

You have to call trackPageView after setVisitorCookieTimeout.

You can’t use setVisitorCookieTimeout by itself to expire cookies.


(maze) #5

Thank you. I set the timeout AFTER the trackPageView. Now it works!