I’m having issues with logging into Matomo after editing the config.ini.php file. What I edited was the database information because I imported a backup database into MySQL. That part was successful, editing the config.ini.php file was successful because I got the login page afterwards but it doesn’t recognize my superuser login credentials that I created when I initially setup Matomo. It just says wrong username and password or an error stating the form security failed because of a token mismatch. Has anyone run into this issue?
I know some folks might end up here because they are getting the error too: Error: The form security failed because of a token mismatch. Please reload the form and check that your cookies are on.
Here are general tips:
That error occurs only if the stored token and the submitted one do not match.
Possible reasons could be that the token was already invalidated by another request or storing it in the session failed for any reason.
if cookies are disabled / not allowed that might also happen.
Did you change anything on your Matomo instance. Maybe the apache config was changed or similar. Or it had been https and not it isn’t anymore…
A simple way to check if cookies are on, in your browser, is to go to the dev tools console and execute this, or just look at that object property:
if (navigator.cookieEnabled) {
console.log("Cookies are enabled.");
} else {
console.log("Cookies are disabled.");
}