What we are trying to achieve is an improvement to our TTFB. In that regards, we decided to cache our public pages.
We have a modal for register/sign in on the site and the login process itself is done through an ajax call.
The php back end handle the session/cookie creation on successful login and there is a json response at the end of the pack end process. The json response contains the referrer url and we are using reload(true) if the url does not contain # otherwise its a location.window.href for redirection/reload.
So for our cache test on cloudflare, we are bypassing the cache if our login cookie is present. We set up the rule on a single page for now.
Now to the issue at hand. We activated the cache on cloudflare and upon login, the redirection happens, but the login cookie is as if not taken into account and the page remains not logged. But if we refresh the page again, then the cookie is taken into account and the page is loaded with the user logged in.
Has anyone experience this issue before when activating the cache on cloudflare please? Any setting we might have missed? Please advice. Any help would be greatly appreciated.