cancel
Showing results for 
Search instead for 
Did you mean: 

customer_data not loaded on custom login controller in Magento 2.3.4 and 2.3.5

customer_data not loaded on custom login controller in Magento 2.3.4 and 2.3.5

I have a SSO module with a custom login controler.

After login, when the main page is loaded, the customer_data is not available on js.

I read the private content documentation and I'm already invalidating the private content by a
Vendor/ModuleName/etc/frontend/sections.xml file

I created a GitHub issue here describing the issue in detail:
https://github.com/magento/magento2/issues/28428

Can someone help? It seems it affects more people.

1 REPLY 1

Re: customer_data not loaded on custom login controller in Magento 2.3.4 and 2.3.5

Had similar issue.

In file vendor/magento/module-customer/Controller/Account/LoginPost.php

there is a code piece you've probably forgot to add to your custom login action:

if ($this->getCookieManager()->getCookie('mage-cache-sessid')) {
    $metadata = $this->getCookieMetadataFactory()->createCookieMetadata();
    $metadata->setPath('/');
    $this->getCookieManager()->deleteCookie('mage-cache-sessid', $metadata);
}

However, it should work fine without this code as it is deprecated.

 

Another reason could be that you've named your custom action in sections.xml wrong - there should be a front name, not a route ID.