# Syncing login status between WordPress and Discourse, Discourse SSO provider

**URL:** <https://meta.discourse.org/t/syncing-login-status-between-wordpress-and-discourse-discourse-sso-provider/67980>\
**Category:** WordPress\
**Created:** [August 13, 2017, 7:56pm UTC](https://meta.discourse.org/t/syncing-login-status-between-wordpress-and-discourse-discourse-sso-provider/67980 "2017-08-13T19:56:09Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [July 10, 2018, 2:56am UTC](https://meta.discourse.org/t/syncing-login-status-between-wordpress-and-discourse-discourse-sso-provider/67980/5 "2018-07-10T02:56:10Z")

</div>

> [@Lew\_Grothe](#):
>
> The original WP instance will not see the user as logged out

Is the basic issue you’re trying to solve that when a user is logged out on WordPress, you want them to be logged out in all WordPress sessions? [wp\_ajax\_destroy\_sessions() – Function | Developer.WordPress.org](https://developer.wordpress.org/reference/functions/wp_ajax_destroy_sessions/)

Edit: I think you could use the logic that’s in the `wp_ajax_destroy_sessions` function to write your own function that would do the same thing. The [WP Discourse](https://github.com/discourse/wp-discourse) plugin should have an action hook added to it that fires right before it calls `wp_logout`. I can get that added in the next update. You should be able to hook into that action to log users out from all sessions.

---

_[View the full topic](https://meta.discourse.org/t/syncing-login-status-between-wordpress-and-discourse-discourse-sso-provider/67980)._
