Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure to initialize a session for the anonymous user #16423

Merged
merged 1 commit into from Sep 11, 2020
Merged

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Sep 10, 2020

What happened is that every time an anonymous user would view a widget or report in the Matomo UI it would log a failed authentication (for brute force check) and eventually the anonymous user would be blocked. This is because of the code here: https://github.com/matomo-org/matomo/blob/4.0.0-a1/core/Access.php#L171-L174

The session auth always thinks that the session is expired because for anonymous user we had actually never started a session. When someone logs in, we would start the session in the login controller in https://github.com/matomo-org/matomo/blob/4.0.0-a1/plugins/Login/Controller.php#L309 but for anonymous users there is no log in.

Therefore initialising the session now when needed in the frontcontroller.

@tsteur tsteur added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Sep 10, 2020
@tsteur tsteur added this to the 4.0.0 milestone Sep 10, 2020
@diosmosis
Copy link
Member

diosmosis commented Sep 11, 2020

Will this be an issue if multiple people end up using the same session simultaneously? (Or will they not actually use the same session simultaneously?)

EDIT: Actually I think the PHPSESSID would be different so should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants