Do you see the Cloudflare page before or after you click Login the first time?
Since making this thread I have been kept logged in so I'm happy.
I used to go to https://forums.alliedmods.net/index.php
Click "Log in" and enter my username and password.
The cloudflare page would show up and redirect me back to https://forums.alliedmods.net/index.php
I then logged in again, cloudflare page would show up and I'd get signed in.