Logout user and delete cookies from the client side?

You should be able to combine the solutions in these answers to achieve what you are looking for. Keep checking and if the internet connection drops, clear the cookies. https://stackoverflow.com/questions/10426851/quickest-way-to-check-internet-connectivity-in-js https://stackoverflow.com/questions/179355/clearing-all-cookies-with-javascript

wp_logout() changes in WordPress 5.1.1

A lot has changed in 5.1/5.1.1, but the changes I’m seeing in WordPress core wouldn’t cause 302 redirects on their own. 1. wp_logout is pluggable wp_logout is a pluggable function. That means anyone can override this function and cause it to do something different because the function is wrapped in a condition checking for other … Read more

Logout redirects to a broken page(home URL is omitted)

Found the answer. It is a bug in WordPress v5.2.3 affecting WordPress in Windows environments. Caused by backslashes in Windows paths that aren’t stripped correctly Details here: https://core.trac.wordpress.org/ticket/47980 I have tried the patch suggested and can confirm it solves the problem. replace: $location = “https://wordpress.stackexchange.com/” . ltrim( $path . “https://wordpress.stackexchange.com/”, “https://wordpress.stackexchange.com/” ) . $location; with … Read more

Logout issue with new Domain on WP Multisite

I asked on the WordPress MU Domain Mapping plugin support page and it turns out it was a setting in the plugin that needed to be turned off. I turned off Redirect administration pages to site’s original domain and it’s working now. Thanks for your ideas and help!

How do you log a user out with wp_logout?

If you’re using wp_logout in your own code, its probably best to exit or wp_redirect immediately afterwards. You can call wp_set_current_user(0) after wp_logout() to manually log the user out instantly, if you need to continue executing PHP but don’t want the user to be logged in.