diff options
author | Stefan Giehl <stefan@matomo.org> | 2021-07-13 11:21:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-13 11:21:51 +0300 |
commit | fa66bc580852c2b098ba5ea7f7ba57048f258714 (patch) | |
tree | c853dcd88d842418a1ace4bddfa5842bbc10e502 /core | |
parent | befedffaa6b5f28b6d6f804a7355b7078f7efc30 (diff) |
Fix possible warning that session is not active for anonymous user (#17758)
* Fix possible warning that session is not active for anonymous user
* update test
Diffstat (limited to 'core')
-rw-r--r-- | core/FrontController.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/FrontController.php b/core/FrontController.php index 359df2fa99..3928587017 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -409,7 +409,8 @@ class FrontController extends Singleton && Piwik::isUserIsAnonymous() && $authAdapter->getLogin() === 'anonymous' //double checking the login && Piwik::isUserHasSomeViewAccess() - && Session::isSessionStarted()) { // only if session was started, don't do it eg for API + && Session::isSessionStarted() + && Session::isWritable()) { // only if session was started and writable, don't do it eg for API // usually the session would be started when someone logs in using login controller. But in this // case we need to init session here for anoynymous users $init = StaticContainer::get(SessionInitializer::class); |