Closed
Description
Preconditions (*)
- Magento 2.3.2
Steps to reproduce (*)
Call method Magento\Customer\Model\Account\Redirect::setRedirectCookie()
$this->accountRedirect->setRedirectCookie($this->urlBuilder->getUrl('checkout'));
Expected result (*)
Cookie login_redirect
created
Actual result (*)
The cookie is sent to the browser, but not properly. All the cookie params are missing.
Additional information
I checked the code and the problem is that the method setPublicCookie
needs to include a PublicCookieMetadata
instance as third param.
<?php
// vendor/magento/module-customer/Model/Account/Redirect.php:280
/**
* Save redirect route to cookie for case of successful login/registration
*
* @param string $route
* @return void
*/
public function setRedirectCookie($route)
{
$this->getCookieManager()->setPublicCookie(self::LOGIN_REDIRECT_URL, $route);
}
Indeed maybe setPublicCookie
should require $metadata
as mandatory. Why someone would need to create a cookie without params?
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.4-develop branchGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.3 release