Login Error" Form security failed

Yesterday I started having problems trying to login into my self hosted installation (not WordPress). I recently started using Cloudflare as well but Matomo was working fine for about 4 days until suddenly yesterday I started getting the login error. I tried following all of the suggestions that Matomo has with changes to the config.ini file but nothing works. As soon as the login page displays, it throws an error. Does anyone know how to solve this problem?

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.