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

Can't login in Chrome #14210

Closed
vitobotta opened this issue Mar 16, 2019 · 10 comments
Closed

Can't login in Chrome #14210

vitobotta opened this issue Mar 16, 2019 · 10 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@vitobotta
Copy link

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
Copy link
Contributor

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

@vitobotta
Copy link
Author

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
Copy link
Contributor

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

@mattab
Copy link
Member

mattab commented Jul 9, 2019

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
Copy link
Author

vitobotta commented Jul 10, 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
Copy link
Member

tsteur commented Jul 10, 2019

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

@vitobotta
Copy link
Author

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

I am forcing https.

@ymbZzz
Copy link

ymbZzz commented Oct 16, 2019

I have the same problem, how to solve it

@ymbZzz
Copy link

ymbZzz commented Oct 17, 2019

hi ,i can login in chrome finally by adding the port after X-Forwarded-Host
this is my setting
nginx:
server {
listen YOUR_PORT;
server_name xxx-matomo;
location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host:YOUR_PORT;
proxy_set_header X-Real-IP $remote_addr;
//matomo-base is kubernetes service name
proxy_pass http://matomo-base;
}
}

config.ini.php:
proxy_client_headers[] = "HTTP_X_FORWARDED_FOR"
proxy_client_headers[] = "X-Real_IP"
proxy_host_headers[] = "HTTP_X_FORWARDED_HOST"
//matomo-base is kubernetes service name
proxy_ips[] = "http://matomo-base"
salt = "xxx"
enable_trusted_host_check=0

@tsteur
Copy link
Member

tsteur commented Oct 17, 2019

Awesome thanks

@tsteur tsteur closed this as completed Oct 17, 2019
@tsteur tsteur added the answered For when a question was asked and we referred to forum or answered it. label Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

5 participants