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

B2B eCommerce: All You Need to Know in 2024

As Bill Gates once said: “If your business is not on the Internet, then your business will be out of business”. This statement is especially relevant during the era of globalization. What’s more, it’s vital not only as a way to approach your potential customers. It’s also

Read more

Best BigCommerce Themes 2024: Overview

Did you know that 59% of internet users are looking for beautifully designed websites? There’s nothing strange about it since it’s logical that the appealing website design won’t distract people. Your potential customers might have some expectations from your online store, that’s why it’s better

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