Prevent cross site authentication for logged in users on WordPress multisite

Blog

8 thoughts on “Prevent cross site authentication for logged in users on WordPress multisite

  1. Thanks for sharing this informative piece of writing about preventing cross site authentication issues for logged in users on WordPress multi-site environment. This post is very helpful indeed.

    1. Hi,

      you can try to enable debugging in WordPress by adding the following to your wp-config.php file:

      define(‘WP_DEBUG’, true);
      define(‘WP_DEBUG_LOG’, true);

      this will write any PHP related errors to a debug.log file in your /wp-content/ folder and should provide more information about the exact cause of your issue.

        1. Hi,

          $this can only be used within a class, you are likely implementing this code outside of a class. To fix this, remove the $this reference.

          add_action(‘authenticate’, array($this, ‘validate_on_login’), 100, 3);

          Becomes

          add_action(‘authenticate’, ‘validate_on_login’, 100, 3);

          1. I get the following error
            Parse error: syntax error, unexpected ‘validate_on_login’ (T_STRING) in

Leave a Reply

Your email address will not be published. Required fields are marked *

×