PHP Sessions of WHMCS may not work when you are using Cloudflare on your domain name. So, here's the permanent solution:
Solving the problem from Cloudflare:
- Log into your Cloudflare account.
- Select the domain name.
- Go to the firewall option and set it to "Low".
- It should be solved now!
Note: It is not recommended to set the firewall as low, since your website may get down if anyone attacks your website with DOS/DDoS.
Solving the problem from WHMCS:
- Log into your WHMCS admin dashboard.
- Go to System Settings » General Settings » Security tab.
- Check "Disable Session IP Check" and save the changes.
- Now, visit Cloudflare CIDR IPs and add them to Trusted Proxies.
- No need to input X_FORWARDED_FOR in Proxy IP Header.
- Again, uncheck "Disable Session IP Check" and save the changes.
- It's done! You won't have the issue from now!