Is there an event or a method i can use with a plugin that i can use as soon as the customer session is initialised on each and every request?

I want to check some data on the session at the soonest possible time.

I think controller_action_predispatch is to early.

1 Answer 1


For this case,you can use event customer_data_object_login.

From this event fire after customer credential is valid and set customer ain session.

But after set customer data in session, at Magento\Customer\Model\Session:regenerateId() is called and this function reset the session id of a customer session.

On this function you can use plugin.I guess that is best idea

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.