setBrowserHasCookies() публичный Метод

Sets if the browser supports cookies This is reported in "List of plugins" report in Piwik.
public setBrowserHasCookies ( boolean $bool )
$bool boolean
Пример #1
0
 /**
  * Returns a PiwikTracker object that you can then use to track pages or goals.
  *
  * @param         $idSite
  * @param         $dateTime
  * @param boolean $defaultInit If set to true, the tracker object will have default IP, user agent, time, resolution, etc.
  *
  * @return PiwikTracker
  */
 public static function getTracker($idSite, $dateTime, $defaultInit = true, $useLocal = false)
 {
     if ($useLocal) {
         require_once PIWIK_INCLUDE_PATH . '/tests/LocalTracker.php';
         $t = new Piwik_LocalTracker($idSite, self::getTrackerUrl());
     } else {
         $t = new PiwikTracker($idSite, self::getTrackerUrl());
     }
     $t->setForceVisitDateTime($dateTime);
     if ($defaultInit) {
         $t->setIp('156.5.3.2');
         // Optional tracking
         $t->setUserAgent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)");
         $t->setBrowserLanguage('fr');
         $t->setLocalTime('12:34:06');
         $t->setResolution(1024, 768);
         $t->setBrowserHasCookies(true);
         $t->setPlugins($flash = true, $java = true, $director = false);
     }
     return $t;
 }
 /**
  * Returns a PiwikTracker object that you can then use to track pages or goals.
  *
  * @param $idSite
  * @param $dateTime
  * @param $defaultInit If set to true, the tracker object will have default IP, user agent, time, resolution, etc.
  * @return PiwikTracker
  */
 protected function getTracker($idSite, $dateTime, $defaultInit = true)
 {
     $t = new PiwikTracker($idSite, $this->getTrackerUrl());
     $t->setForceVisitDateTime($dateTime);
     if ($defaultInit) {
         $t->setIp('156.5.3.2');
         // Optional tracking
         $t->setUserAgent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)");
         $t->setBrowserLanguage('fr');
         $t->setLocalTime('12:34:06');
         $t->setResolution(1024, 768);
         $t->setBrowserHasCookies(true);
         $t->setPlugins($flash = true, $java = true, $director = false);
     }
     return $t;
 }