Fix NodeBB "Invalid Session" behind Cloudflare
Go to your cloudflare dashboard> caching>caching level and select
- No Query String -
Then Purge everything under purge cache session and reload your website.
I hope it helps people looking for a solution to this problem.
its not much but at least you can have some of the cloudflare features on.
You can check my forum, it is working after 3 days looking for a solution : ParaLocos.org
@yoyimc9 Yes. @yariplus found out about this too. We know what the problem is and are discussing if we can add it to the NodeBB master or if we need to do a plugin for that, even though I think that may be overkill. Basically the problem is that the session cookie for NodeBB is set to
something.domain.tld, or in your case
paralocos.org. It should be
*.paralocos.orgso that the
live.domain.tldcan authorize with the cookie too.
@lenovouser Looks like mine is a different issue. I tried his suggestion, and I still get invalid session. Although, it did fix the query string.
@yariplus i test this in various environments and in some i need to login first in the live.example.com to set the cookie and then i can login in the example.com domian without the invalid session error. I hope it get fixed in the upcoming releases. Also in some i have to disable the emoji extend plugin.
@yoyimc9 Ah, excellent. That confirms there's something amiss with the session cookie.
But, your site works without the second cookie, the mystery continues...
I figured it out.
An updated must have messed up the session cookie setting (Settings=>Advanced=>Cookie). It was set to the default ".domain.tld" but what it was actually using was "domain.tld" (without the wildcard dot). I just set it to some bogus value, then set it back to default. Now it works as intended.
Cloudflare just realese WebSockets for all CloudFlare costumers https://support.cloudflare.com/hc/en-us/articles/200169466-Can-I-use-CloudFlare-with-WebSockets-
Yep, just turned it on, seems to be working without issue.
That's awesome news from CloudFlare! :)