Need to refresh in order to get logged into discourse. Anyone else experiencing this?

Howdy again. We’re using all the latest versions of wordpress + discourse + wp-discourse plugin with the sso settings filled out.

Single sign-on seems to be working for the most part but I every time I find that initially when I bring up our discourse site it shows that I am not logged into discourse. But then I refresh the browser and then I show up as logged in. This is a little less than ideal.

Is there a way around this? Like some setting I may have missed?

Or does this happen to everyone else and you just live with it?

Thanks!

I haven’t seen this behavior in my test site using Chrome, Firefox, and Safari. Perhaps an issue with how your browser is handling cookies?

If you have logged into Discourse through the WordPress site it should keep you logged in to Discourse until you log out. You shouldn’t need to refresh the page to see that you are logged in. I’m not sure what is happening for you here.

Now that I get more familiar with what’s happening, I see that it’s not that I need to refresh but actually that I have to click on the Login button in discourse in order to get myself logged in to discourse.

So basically it’s working like this:

  1. Go to the wordpress site and login as usual
  2. Then go to the discourse site and I’m not logged in there
  3. Click on the Login button in discourse and I’m instantly logged in to discourse

Is this how it’s supposed to work? I expected it to work like this:

  1. Go to the wordpress site and login as usual
  2. Then go to the discourse site and be already logged in based on the fact that I just logged in via wordpress

Yes, that’s how it’s supposed to work. Although, when you click on the ‘Continue the discussion’ link on the WordPress site, you will be automatically logged in to Discourse and then redirected to the topic. It wouldn’t be too hard to create a general link on the WordPress site that logged the user in and then redirected them to the forum’s homepage.

2 Likes

Another option if you check out section c of the following post for syncing the login. I use this on my site.

https://meta.discourse.org/t/wordpress-integration-guide/27531

1 Like

OK excellent. Super helpful replies. Thank you both!

I’m looking forward to reading that integration guide. I wasn’t sure if it applied to the situation where you are using the wp-discourse plugin since it seemed like it was a different custom solution.