Skip to content

Commit

Permalink
Rename Piwik -> Matomo in cookies (#16053)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteur authored Jun 11, 2020
1 parent 192ba70 commit 59698ee
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion PRIVACY.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ purge old data. You can configure Matomo to automatically delete log data older

### Include a tracking Opt-Out feature on your site
In your website, we recommended providing an easy way for your visitors to “opt-out” of being tracked by Matomo.
You can use the Opt-Out feature to display a link your website that sets a special browser cookie (`piwik_ignore`) when
You can use the Opt-Out feature to display a link your website that sets a special browser cookie (`matomo_ignore`) when
clicked. Visitors that click that link will be ignored by Matomo in the future:
[How to include a tracking opt-out iframe.](https://matomo.org/docs/privacy/#step-3-include-a-web-analytics-opt-out-feature-on-your-site-using-an-iframe)

Expand Down
4 changes: 2 additions & 2 deletions config/global.ini.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@
force_ssl = 0

; (DEPRECATED) has no effect
login_cookie_name = piwik_auth
login_cookie_name = matomo_auth

; By default, the auth cookie is set only for the duration of session.
; if "Remember me" is checked, the auth cookie will be valid for 14 days by default
Expand Down Expand Up @@ -825,7 +825,7 @@
scheduled_tasks_min_interval = 3600

; name of the cookie to ignore visits
ignore_visits_cookie_name = piwik_ignore
ignore_visits_cookie_name = matomo_ignore

; Comma separated list of variable names that will be read to define a Campaign name, for example CPC campaign
; Example: If a visitor first visits 'index.php?matomo_campaign=Adwords-CPC' then it will be counted as a campaign referrer named 'Adwords-CPC'
Expand Down
2 changes: 1 addition & 1 deletion core/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static function start($options = false)
// incorrectly invalidate the session
@ini_set('session.referer_check', '');

// to preserve previous behavior piwik_auth provided when it contained a token_auth, we ensure
// to preserve previous behavior matomo_auth provided when it contained a token_auth, we ensure
// the session data won't be deleted until the cookie expires.
@ini_set('session.gc_maxlifetime', $config->General['login_cookie_expire']);

Expand Down
2 changes: 1 addition & 1 deletion core/Session/SessionFingerprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* against what is stored in the session. If it doesn't then this is a
* session hijacking attempt.
*
* We also check that a hash in the piwik_auth cookie matches the hash
* We also check that a hash in the matomo_auth cookie matches the hash
* of the time the user last changed their password + the session secret.
* If they don't match, the password has been changed since this session
* started, and is no longer valid.
Expand Down
2 changes: 2 additions & 0 deletions core/Updates/4.0.0-b2.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public function getMigrations(Updater $updater)
], ['idinvalidation']);

$migrations[] = $this->migration->db->addIndex('archive_invalidations', ['idsite', 'date1', 'period'], 'index_idsite_dates_period_name');
// keep piwik_ignore for existing installs
$migrations[] = $this->migration->config->set('Tracker', 'ignore_visits_cookie_name', 'piwik_ignore');

return $migrations;
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/Login/tests/Integration/SessionInitializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private function makeMockAuth($resultCode)

private function assertAuthCookieIsAbsent()
{
$this->assertArrayNotHasKey('piwik_auth', $_COOKIE);
$this->assertArrayNotHasKey('matomo_auth', $_COOKIE);
}

private function assertAuthCookieIsCreated(Cookie $cookie)
Expand All @@ -75,7 +75,7 @@ private function assertAuthCookieIsCreated(Cookie $cookie)

private function createAuthCookie()
{
$_COOKIE['piwik_auth'] = 'login=czo5OiJ0ZXN0bG9naW4iOw==:token_auth=czozMjoiOWU5MDYxZjk2MDI0YTY3NWFmOGFkNWZmNmNiZGY2ZGMiOw==';
$_COOKIE['matomo_auth'] = 'login=czo5OiJ0ZXN0bG9naW4iOw==:token_auth=czozMjoiOWU5MDYxZjk2MDI0YTY3NWFmOGFkNWZmNmNiZGY2ZGMiOw==';
}

private function assertAuthCookieIsDeleted(Cookie $cookie)
Expand Down

0 comments on commit 59698ee

Please sign in to comment.