Magento does not set the customer session data correctly.
Issue: After logging in, the customer name in the welcome message (Welcome
Environment:
Magento: M 2.1.1
Cache: Varnish 4 (only FPC disabled) - Prod mode.
OS version: Ubuntu 14.04.4 LTS
PHP: PHP 7.0.9 (Zend Engine: v3.0.0.)
Apache: Apache/2.4.23
AWS - Bitnami installation.
10K+ SKUs
Steps:
On random browsing thru the site, the name gets set (I am not able to figure out what causes it to set) and then its all fine - the name appears and the mini cart is updated.
This is a consistent issue and can be reproduced every time.
Please treat this as high priority. The sales are getting impacted because of this. Suggest a workaround if any.
I can't reproduce this. Ensure you have permissions set correctly, try clearing magento and browser caches.
Please note that Full Page Cache (FPC) is disabled for now (and might have to keep it that way for sometime for a reason).
When we enable the FPC, the issue is less prominent, but we sill do not get a refresh automatically.
The issue also happens to me on Magento 2.1.1
Yeah, for me also. But not all time (almost)
Have you tried disabling varnish or change application mode?
Varnish is enabled. Mode is production.
I also have the same issue. Frequency of occurrence is always.
Magento 2.1.2
Composer install and upgraded from 2.1.1 to 2.1.2
Debian Jessie 8
PHP7.0 w/ opcache enabled
Mode is developer
Using redis - setup per devdocs
Using varnish - setup per devdocs, but have set,
php bin/magento cache:disable
All 3rd party extension disabled
Stock luma theme.
<span class="customer-name" role="link" tabindex="0" data-toggle="dropdown" data-trigger-keypress-button="true" data-bind="scope: 'customer'" aria-haspopup="true" aria-expanded="false">
<span data-bind="text: customer().fullname"></span>
<button type="button" class="action switch" tabindex="-1" data-action="customer-menu-toggle">
<span>Change</span>
</button>
</span>

Picture above is using porto ultimate theme, but the same thing happens with the luma theme even when all 3rd party modules are disabled.

<span data-bind="text: customer().fullname"> some name </span>which should display the missing name in the ul.header.links and or div.panel.header
I have not tested for issues with the cart.
This should be fixed in develop branch https://github.com/magento/magento2/commit/861f596371825d9e24672cd613229ae9486c635f. Could you please try this fix.
@sevos1984 , with https://github.com/magento/magento2/commit/861f596371825d9e24672cd613229ae9486c635f the customer name and welcome message display after 3 seconds. Good work!
Any reason that there is a delay of 2-3 seconds? Anything I can do to shorten this length of time?
Note: I am running in developer mode with php bin/magento cache:disable
Note: I have not tested the mini cart or the re-login at checkout issue mentioned
I modified ./vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php
since app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php does not exist on a composer install.
The file is modified per the fix as follows:
public function aroundDispatch(
\Magento\Framework\App\FrontControllerInterface $subject,
\Closure $proceed,
\Magento\Framework\App\RequestInterface $request
) {
$this->version->process();
if (!$this->config->isEnabled() || $this->config->getType() != \Magento\PageCache\Model\Config::BUILT_IN) {
return $proceed($request);
}
$result = $this->kernel->load();
if ($result === false) {
$result = $proceed($request);
if ($result instanceof ResponseHttp) {
$this->addDebugHeaders($result);
$this->kernel->process($result);
}
Then,
rm -rf ${webroot}/var/view_preprocessed/* ${webroot}/pub/static/*
rm -rf ${webroot}/var/cache/* ${webroot}/var/page_cache/* ${webroot}/var/generation/* ${webroot}/var/di/*
php bin/magento cache:disable
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento --ansi setup:static-content:deploy en_CA
php bin/magento indexer:reindex
php bin/magento cache:flush
Then,
systemctl restart nginx php7.0-fpm
systemctl restart 'varn*'
With enabled cache and production mode this should run faster. You can also enable Merge JavaScript Files, JavaScript Bundling or Minify JavaScript Files to accelerate js. For more information regarding performance configuration contact Community Forums or the Magento Stack Exchange. Thanks.
I've faced this issue after enabling varnish. Anyone solved this issue.
Magento 2.3.2, In /vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php already have following code. Still asking customer to re-login.
if (!$this->config->isEnabled() || $this->config->getType() != \Magento\PageCache\Model\Config::BUILT_IN) {
return $proceed($request);
}
Most helpful comment
This should be fixed in develop branch https://github.com/magento/magento2/commit/861f596371825d9e24672cd613229ae9486c635f. Could you please try this fix.