In magento 2: How can I see the user who is currently logged in from php? and How can I login to a user from code and save it in the database?


Magento provides info about the users currently online under customer section itself.

If you need to get the list of customers currently online you can make use of values from two magento database tables as per your need,


These table have a sessions of customers

You can login as a user by using a plugin https://github.com/magefan/module-login-as-customer

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.