Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Based on the answer from this question How do I programmatically log in a user?
I know how to login in a user, but is there a way to test if user_login_submit was successful or not? It does not have a return value.
You can check if user is logged in or not by using global $user variable, if user is not logged in then $user->uid will be 0 for anonymous users.
Required, but never shown