@vitobotta opened this Issue on March 16th 2019

Hi, I have two installations of 3.8.1, one a "manual" installation and the other with Docker (I'm migrating the first one's db to the second one). I can't login on either of them if using Google Chrome, while I have no problems with Firefox or Safari. I have tried uninstalling Chrome completely and even on another Mac I have the same issue. Whenever I enter my credentials I get the following error:

Error: Form security failed. Please reload the form and check that your cookies are enabled. If you use a proxy server, you must configure Matomo to accept the proxy header that forwards the Host header. Also, check that your Referrer header is sent correctly.

By doing a lot of searching, I have tried so many things but nothing has worked so far. I have tried several combinations of settings in config.ini.php concerning proxy but I wonder why in other browsers it just works. At the moment the settings in the config.ini.php are as follows:

[General]
salt = "..."
trusted_hosts[] = "analytics.domain.com"
assume_secure_protocol = 1
force_ssl = 1
proxy_client_headers[] = HTTP_CLIENT_IP
proxy_client_headers[] = HTTP_X_FORWARDED_FOR
proxy_client_headers[] = HTTP_X_REAL_IP
proxy_host_headers[] = HTTP_X_FORWARDED_HOST

Matomo is behind Nginx in both installations and the proxy settings are as follows (e.g. for the Docker installation):

      proxy_pass http://matomo;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Forwarded-Host $host;

What can I do to be able to log in with Chrome?

Thanks in advance!

@fdellwing commented on March 16th 2019 Contributor

Please check if the cookies get correctly forwarded to the user.

@vitobotta commented on March 16th 2019

Please check if the cookies get correctly forwarded to the user.

Hi, thanks for your reply. Any tips on how I would do that? Also why does it work in Firefox etc if it's an issue with the cookies? Thanks!

@fdellwing commented on March 16th 2019 Contributor

Browsers du handle cookies differently. You should be able to get this information from the browsers dev tools.

@mattab commented on July 9th 2019 Member

could you upgrade to the latest Matomo version? see https://matomo.org/docs/update/

if you still experience this issue afterwards, could you maybe create a phpinfo.php file with the content <?php phpinfo(); and post a link to this "phpinfo" page?

Hope we can troubleshoot this issue and find the root cause!

@vitobotta commented on July 10th 2019

Hi @mattab, I am running 3.10.0 with Docker. I just upgraded to that version but I still have the same problem. Here it shows that the image has been updated 10 hours ago, so it should be the one you are referring to? I still have the cookies/proxy error. Thanks!

@tsteur commented on July 10th 2019 Member

Check if you use http vs https maybe in another browser?

@vitobotta commented on July 15th 2019

Check if you use http vs https maybe in another browser?

I am forcing https.

Powered by GitHub Issue Mirror