WP Discourse as SSO client doesn't log me out from Discourse when logging out from Wordpress

AI-generated summary

A user, Canapin, is experiencing issues with the WP Discourse plugin as an SSO client, where logging out from WordPress doesn’t log them out from Discourse. simon suggests that being an admin on WordPress might be the cause, as syncing logout with Discourse relies on the WordPress wp_clear_auth_cookie function, which can be overwritten by other plugins. Canapin notes that they log in from WordPress as an SSO client and that their Discourse site is not set to ‘login required’. The issue only seems to occur with their admin account, while another regular user account logs out correctly.

Hi.

Option is checked but not working.

Any idea?

It should work. Did the user login to WordPress through Discourse? Is your Discourse site set to ‘login required’? Do you know if this is failing for all users on your forum, or just a particular user?

Hi, I log from Wordpress as SSO client and my Discourse is not login required. The option seems to work when I log in/out with another account (which is a regular user). Could it be because I’m an admin on Wordpress and/or Discourse?

Being an admin on Discourse shouldn’t have any effect. It’s possible that it is having an effect on the WordPress end though. Syncing logout with Discourse depends on the WordPress wp_clear_auth_cookie function. That is a ‘pluggable’ WordPress function. That means that the function can be overwritten by other plugins. Possibly there is a less fragile hook that the WP Discourse plugin could use for syncing logout. I’ll take a look at that.