Ticket #1364: cookie_naming.patch

File cookie_naming.patch, 1.9 KB (added by halfdan, 2 years ago)

Adds "exclude_webmaster_cookie_name" to global.ini.php and adjusts code.

  • plugins/UsersManager/Controller.php

     
    147147 
    148148        protected function getIgnoreCookie() 
    149149        { 
    150                 return new Piwik_Cookie(Piwik_Tracker_Visit::COOKIE_IGNORE_VISITS); 
     150                return new Piwik_Cookie( 
     151                        Zend_Registry::get('config')->Tracker->exclude_webmaster_cookie_name 
     152                ); 
    151153        } 
    152154         
    153155        protected function isIgnoreCookieFound() 
  • core/Tracker/Visit.php

     
    5454        protected $refererUrlParse; 
    5555        protected $currentUrlParse; 
    5656 
    57         const COOKIE_IGNORE_VISITS = 'piwik_ignore'; 
    58          
    5957        function setRequest($requestArray) 
    6058        { 
    6159                $this->request = $requestArray; 
     
    519517         */ 
    520518        protected function isIgnoreCookieFound() 
    521519        { 
    522                 $cookie = new Piwik_Cookie(Piwik_Tracker_Visit::COOKIE_IGNORE_VISITS); 
     520                $cookie = new Piwik_Cookie(Piwik_Tracker_Config::getInstance()->Tracker['exclude_webmaster_cookie_name']); 
    523521                if($cookie->isCookieFound()) 
    524522                { 
    525523                        printDebug('Piwik ignore cookie was found, visit not tracked.'); 
  • config/global.ini.php

     
    190190; Defaults to empty. See spec in http://curl.haxx.se/rfc/cookie_spec.html 
    191191cookie_path =  
    192192 
     193; name of the cookie used to exclude visits from the webmaster 
     194exclude_webmaster_cookie_name = piwik_ignore 
     195 
    193196; variable name to track any campaign, for example CPC campaign 
    194197; Example: If a visitor first visits 'index.php?piwik_campaign=Adwords-CPC' then it will be counted as a campaign referer named 'Adwords-CPC' 
    195198campaign_var_name                       = piwik_campaign