How can you leverage wp_set_auth_cookie to programmatically login a user on a specific blog in a multisite environment?

wp_set_auth_cookie doesn't allow you to set the target blog to authenticate the user under. I have a multisite/buddypress setup where activations happen on the primary domain. I want to then automatically authenticate that user not for the main site, but for one his site that was created on registration.

  • What kind of login you want ? How username and password will passed for login Commented Aug 5, 2014 at 7:04
  • more details please Commented Aug 5, 2014 at 8:16
  • @MarkKaplun I've provided a more extensive explanation. Please let me know if that isn't sufficient. Thank you.
    – etc
    Commented Aug 6, 2014 at 3:34

1 Answer 1


In a wordpress network the users are of the network and not an individual blog in the network. This means that technically users do not login to a blog they can only login to the network.

If I understand your question correctly, you have nothing to do for what you want, this is how a network works - once you are logged-in, even if it was done in the context of a specific blog, you are logged-in to all blog (with totally different permission levels, but logged-in)

  • Thanks for your response. So there's no way to log them into their specific subdomain, correct? They'll still be asked to login again, which is what I'm trying to avoid.
    – etc
    Commented Aug 7, 2014 at 4:03
  • no, once they are logged into the main they are also logged to the others. Commented Aug 7, 2014 at 4:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.