Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2013-10-30 09:25:42 +0400
committermattab <matthieu.aubry@gmail.com>2013-10-30 09:25:42 +0400
commit9c3d3108d8cb45d58ca9ce87c9620ed4d11ca170 (patch)
tree8c15b924b1cb1197d49b9f5fd52f22c3bbe130ca /libs
parent3edbb401b8c062dd9c8d77abd7587b56a359da2f (diff)
Simpler cookie setters to keep build green
Diffstat (limited to 'libs')
-rw-r--r--libs/PiwikTracker/PiwikTracker.php20
1 files changed, 8 insertions, 12 deletions
diff --git a/libs/PiwikTracker/PiwikTracker.php b/libs/PiwikTracker/PiwikTracker.php
index bc7660b3ee..71c9459329 100644
--- a/libs/PiwikTracker/PiwikTracker.php
+++ b/libs/PiwikTracker/PiwikTracker.php
@@ -1365,22 +1365,18 @@ class PiwikTracker
$this->loadVisitorIdCookie();
}
- // Set the 'ses' cookie
- if (!$this->getCookieMatchingName('ses')) {
- // new session (new visit)
- $this->visitCount++;
- $this->lastVisitTs = $this->currentVisitTs;
-
- // Set the 'ref' cookie
- $attributionInfo = $this->getAttributionInfo();
- if(!empty($attributionInfo)) {
- $this->setCookie('ref', $attributionInfo, $this->configReferralCookieTimeout);
- }
+ // Set the 'ref' cookie
+ $attributionInfo = $this->getAttributionInfo();
+ if(!empty($attributionInfo)) {
+ $this->setCookie('ref', $attributionInfo, $this->configReferralCookieTimeout);
}
+
+ // Set the 'ses' cookie
$this->setCookie('ses', '*', $this->configSessionCookieTimeout);
// Set the 'id' cookie
- $cookieValue = $this->getVisitorId() . '.' . $this->createTs . '.' . $this->visitCount . '.' . $this->currentTs . '.' . $this->lastVisitTs . '.' . $this->lastEcommerceOrderTs;
+ $visitCount = $this->visitCount + 1;
+ $cookieValue = $this->getVisitorId() . '.' . $this->createTs . '.' . $visitCount . '.' . $this->currentTs . '.' . $this->lastVisitTs . '.' . $this->lastEcommerceOrderTs;
$this->setCookie('id', $cookieValue, $this->configVisitorCookieTimeout);
// Set the 'cvar' cookie