As reported in the forum: http://forum.piwik.org/index.php?showtopic=5141, I am asking for a new feature that I can customize the cookie path, it can be in config.ini.php or in global.ini.php:
; login cookie name login_cookie_name = piwik_auth ; login cookie expiration (30 days) login_cookie_expire = 2592000 ; login cookie path login_cookie_path = /
By default, the piwik cookie is in "/piwik/" if I install it to /piwik folder. And there is no way for my app to read its cookie since the path is different (in this case my app is installed under /myapp/). It is very convenient for me to change it to "/" so that the cookie is accessible to all apps under the same domain.
Default behaviour should be the current, more restrictive behaviour, for backward compatibility and handling cases like www.example.com/~user1 vs www.example.com/~user2
(In ) Fixes #1155 Cookie path can now be defined in config file