Can only log in and out in development mode


Having a major headache getting this working with Wordpress.

  1. When I access my site and choose sign in - my page page refreshes and I am still signed out.
  2. I repeat the step and it signs me in
  3. I access the back-end dashboard
  4. I click to access the front-end again - I am signed out again (but only in cache because I can still access my back-end)

I have setup page rules:

Everything works fine when I switch cloudflare into dev mode so I know it’s an issue here.

Can anyone help please?


Place #1 last. Right now it catches all requests and hence everything gets cached.

Hi Sandro, thank you for the suggestion but I am still getting the same problem.

See it in action here:

Did you purge the cache?

Yes, and cleared my browser cache.

I have turned off Varnish server side too. When I switch to development mode it all works as it should…

Then you are still caching too much. You might want to turn off the cache everything rule for now and check what exactly you can cache and what not.

Notice how, when I switch to another page, it does recognise I am signed out, but then signed back in when I go back to the home page

Ah yes, when I disable that page rule it works perfectly.

Any advice where I should go from here? Is it even worth using CF if I cannot use caching?

Well, Cloudflare will by default cache all non-dynamic resources. Your issue is you instruct Cloudflare to cache everything and that is what happens.

You need to check which resources you can cache and which not, however considering your site does appear to be mostly dynamic you probably should not have a cache everything rule in the first place but only use the defaults.

Thank you so much, that’s been a real pain for me!

If you disable the cache everything rule you can remove all three rules and you probably don’t want “Security” disabled on the other paths anyhow. If you are unsure you can also just disable for now.

I’m just unsure what CF is doing for me if I am not utilising the cache. Think I will remove it from site and monitor site performance. has a lot on that.

Yes, thanks for your help, I marked your solution. I can sleep easier :slight_smile:

1 Like

Cloudflare offers quite a few nifty features, but if your site is performing fine and you are not necessarily after the firewall features you don’t absolutely need to have your site on Cloudflare. It comes down to what you need.

It has added ~1 second to my GT Metrix load by disabling the cache. I did re-enable varnish though.

I would like to use cache at DNS level but if users are going to be getting knocked about not being able to login/logout smoothly…

I can’t really think of a rule that gets around it because I can log in and log out from any and every page - it’s an ajax popup available within the page header.

As long as you use the caching defaults you should not have any issues. What you experienced before was because of that page rule.

Ok thanks, good man!

This topic was automatically closed after 31 days. New replies are no longer allowed.