0

Can I directly get the data of the user that I just logged in with craft()->userSession->login($username, $password) ? (not from a method that uses the SESSION like craft()->userSession->getUser() though)

1 Answer 1

2

If you have the any identifying information about the user (user ID, email, username, UID), you can use one of the UsersService's methods:

craft()->users->getUserById()

craft()->users->getUserByUsernameOrEmail()

craft()->users->getUserByUid()

craft()->users->getUserByEmail()

They will each return a UserModel object to interact with.

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.