Piwik cookies break caching in WordPress

Hi, I have a caching setup on WP that uses Vary: Cookie. Site is installed as /blogg

Under /stats on same server I have Piwik installed.

Problem is that Piwik adds cookies at / causing Vary: Cookie to kick in and no caching occouring on HTML which is a shame.

I tried to set the config.ini.php cookie_path and global.ini.php cookie path, but it doesn’t seem to affect cookies that are set from the JS? Is it possible to make Piwik only assign it’s cookies to /stats/ even though the cookies is assigned using a js?

the cookies are first party cookies and must be set in the domain cookie jar

Hi Matt, the problem is that Piwik doesn’t seem to honor it’s cookie path settings. I only want it to set cookies on the /stats part and not on / because it breaks caching because of Vary: Cookie.

Also, the way Piwik does cookies breaks the most used caching mechanism on WordPress, WP-Super-Cache.

Wp-Super-Cache sets Vary: cookie which means it will not cache pages with different cookies. Because Piwik constantly modifies cookies it will prevent caching.

we use wp-super-cache on piwik.org and pages are cached for me?

For the JavaScript tracker, use piwikTracker.setCookiePath()

we use wp-super-cache on piwik.org and pages are cached for me?[/quote]

I’m not sure how because constantly changing cookie values will destroy the ability of any properly-working cache which is using Vary: Cookie (typically used for auth) to do its job.

Possibly you don’t have your cache set up to use Vary: Cookie.

For those of us trying to use caching properly this is very much an issue.