Magento Customer Session is empty

Magento Customer Session is empty

Some Magento developers have been challenges that the user session does not contain data.

The most common problems:

  • user can not log in to the store;
  • user’s comment comes as from guest;
  • do not load user data for forms.

The issue is often difficult to diagnose and accordingly the cause of its occurrence is not always obvious, although this can be solved quite quickly.

List of events that will help you navigate in the search for the right function:

  • controller_front_init_before
  • controller_front_init_routers
  • adminhtml_controller_action_predispatch_start

You need to find all the entry points for these events, usually this is Obsever / Controller and see if there is usage of the sessions. To more accurately determine whether this function is a problem, you can comment out its contents.

As an alternative to sessions, you can use cookies. If information is required to be stored (for example for security reasons) only in a session, it is recommended to use other events.

Other Articles

Case Study: How we shifted 78%+ of B2B Orders to Self-Service in 5 Months Using a Custom B2B Portal

About the Client The client is a globally operating industrial manufacturer specializing in high-precision pumping systems and fluid-handling equipment. The company serves more than 24,000 active B2B customers across manufacturing, chemical processing, food production, and engineering industries. With decades of market presence, the client is recognized for engineering excellence,

Read more

How We Scaled B2B eCommerce Without Rebuilding the Website

From Manual PIM and Email Quotes to Scalable B2B eCommerce in 2 months, without fuss and within budget * e-Commerce integration without rebuilding the existing TYPO3 website * Automated product and pricing updates from PIM (no more manual maintenance) * Real-time or near real-time stock synchronization * Tiered / quantity-based pricing visible to customers as

Read more
Beyond Code – We Build Experiences: Dive Into a Realm Where Every Line of Code Crafts a Story

We don't just code; we breathe life into your digital aspirations. Our expertise in coding is complemented by our design approach and strategic marketing initiatives, ensuring your brand not only looks good but performs exceptionally.

Begin Your Story