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)

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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