This reminds me of an issue I have that results in the same behavior: loading Discourse and it showing me as logged out, but then refresh showing me as logged in.
In my case it happened when I clicked links from Kiwi, (a Gmail stand-alone app for Mac) using Safari as my default browser. I reported the problem here at one point before I realized it was always when clicking the link from Kiwi. If I copied the link and pasted it into an open Discourse tab I wouldn’t have any problems. But if I clicked the link and it used the same open tab, it wouldn’t work.
Just bringing it up in case it helps. Quite possibly unrelated.