So figured I would chime in since I was having this problem.
Specifically, for Cloudflare. I had to add their IPs to WHMCS as Trusted Proxies System Settings > General Settings > Security Tab.
In the **Trusted Proxies** list, I put all of the CIDR IPs from Cloudflare's own website. You can just copy and paste in the xxx.xxx.xxx.xxx/xx (CIDR IP) into WHMCS and add. It works fine like that.
https://www.cloudflare.com/ips/
After that, I changed the "Proxy IP Header" to "X_FORWARDED_FOR".
Seems to be working now. I originally was getting logged out every 2 minutes or so. If that.
I hope this helps someone as I spent a while trying to find an answer.
Also, quickly add those IPs because you might get timed out before finishing. Just log back in and repeat as quickly as possible. Once you hit "Add" and save the IP it actually saves right then. Even though you didn't click the save button at the bottom of the Security Tab