Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Hi baktiaditya,

    User Switching works fine with the Rename wp-login.php plugin. You don’t need to change anything. What is the problem you’re seeing? What are you changing your login URL to?

    Thread Starter baktiaditya

    (@baktiaditya)

    I’m simply set the login url using ‘/login’ and login using ‘administrator’ role user. When you switch to, let say ‘editor’ role, it work fine, but when you go back to ‘administrator’, it will go to grey page ‘Could not switch users.’

    url param stuck at https://wplocal.dev/login/?action=switch_to_olduser&_wpnonce=823aa9d90c&redirect_to=http%3A%2F%2F wplocal.dev%2Fwp%2Fwp-admin%2F%3Fuser_switched%3Dtrue

    Thread Starter baktiaditya

    (@baktiaditya)

    And just let you know, I’m installing wordpress in subfolder.
    WordPress Address (URL): https://wplocal.dev/wp
    Site Address (URL): https://wplocal.dev

    Thank you

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Okay, I’ve taken a look and this is an inherent problem with renaming your login URL. The Rename wp-loginphp plugin uses home_url() to construct the login URL, but if you’re using a separate path for the admin area (as you are), or if you’re using SSL for the admin area but not for the front end, then the authentication cookies which are only meant for URLs under the admin path won’t work.

    If you change your login URL to https://wplocal.dev/wp/login you should find that switching users works as expected.

    This isn’t something that I will address in User Switching because authentication cookies must only be exposed to URLs under the admin URL, and User Switching is strict about this.

    Thread Starter baktiaditya

    (@baktiaditya)

    Thanks John for quick response.
    For now I’ll change my login url to “wp/login”.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can't switch back to user with 'administrator' role’ is closed to new replies.